aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Access/Permissions.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
committerMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
commit4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch)
treeaae7f2582b2b9c6596dcbf87c06a836434140830 /Zotlabs/Access/Permissions.php
parent22c89b6c660e185d5c5c6362acf23b145d932d15 (diff)
parent8fde0f01b8472082158b38386046ed606bcfbc49 (diff)
downloadvolse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip
Merge branch '3.0RC'3.0
Diffstat (limited to 'Zotlabs/Access/Permissions.php')
-rw-r--r--Zotlabs/Access/Permissions.php34
1 files changed, 22 insertions, 12 deletions
diff --git a/Zotlabs/Access/Permissions.php b/Zotlabs/Access/Permissions.php
index 62c4af0ff..bca40a9c1 100644
--- a/Zotlabs/Access/Permissions.php
+++ b/Zotlabs/Access/Permissions.php
@@ -33,19 +33,22 @@ use Zotlabs\Lib as Zlib;
*/
class Permissions {
+ /**
+ * @brief Permissions version.
+ *
+ * This must match the version in PermissionRoles.php before permission updates can run.
+ *
+ * @return number
+ */
static public function version() {
- // This must match the version in PermissionRoles.php before permission updates can run.
return 2;
}
/**
* @brief Return an array with Permissions.
*
- * @hooks permissions_list
- * * \e array \b permissions
- * * \e string \b filter
- * @param string $filter (optional) only passed to hook permission_list
- * @return Associative array with permissions and short description.
+ * @param string $filter (optional) only passed to hook permissions_list
+ * @return array Associative array with permissions and short description.
*/
static public function Perms($filter = '') {
@@ -74,6 +77,11 @@ class Permissions {
'permissions' => $perms,
'filter' => $filter
];
+ /**
+ * @hooks permissions_list
+ * * \e array \b permissions
+ * * \e string \b filter
+ */
call_hooks('permissions_list', $x);
return($x['permissions']);
@@ -84,9 +92,7 @@ class Permissions {
*
* e.g. you must be authenticated.
*
- * @hooks write_perms
- * * \e array \b permissions
- * @return Associative array with permissions and short description.
+ * @return array Associative array with permissions and short description.
*/
static public function BlockedAnonPerms() {
@@ -99,6 +105,10 @@ class Permissions {
}
$x = ['permissions' => $res];
+ /**
+ * @hooks write_perms
+ * * \e array \b permissions
+ */
call_hooks('write_perms', $x);
return($x['permissions']);
@@ -117,6 +127,7 @@ class Permissions {
static public function FilledPerms($arr) {
if(is_null($arr)) {
btlogger('FilledPerms: null');
+ $arr = [];
}
$everything = self::Perms();
@@ -138,7 +149,7 @@ class Permissions {
* to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
*
* @param array $arr associative perms array 'view_stream' => 1
- * @return Indexed array with elements that look like
+ * @return array Indexed array with elements that look like
* * \e string \b name the perm name (e.g. view_stream)
* * \e int \b value the value of the perm (e.g. 1)
*/
@@ -197,11 +208,10 @@ class Permissions {
* @brief
*
* @param int $channel_id A channel id
- * @return associative array
+ * @return array Associative array with
* * \e array \b perms Permission array
* * \e int \b automatic 0 or 1
*/
-
static public function connect_perms($channel_id) {
$my_perms = [];