The Hubzilla
|
Extensible permissions. More...
Static Public Member Functions | |
static | version () |
Permissions version. More... | |
static | Perms ($filter= '') |
Return an array with Permissions. More... | |
static | BlockedAnonPerms () |
Perms from the above list that are blocked from anonymous observers. More... | |
static | FilledPerms ($arr) |
Converts indexed perms array to associative perms array. More... | |
static | OPerms ($arr) |
Convert perms array to indexed array. More... | |
static | FilledAutoperms ($channel_id) |
static | PermsCompare ($p1, $p2) |
Compares that all Permissions from $p1 exist also in $p2. More... | |
static | connect_perms ($channel_id) |
Extensible permissions.
To add new permissions, add to the list of $perms below, with a simple description.
Also visit PermissionRoles.php and add to the $ret['perms_connect'] property for any role if this permission should be granted to new connections.
Next look at PermissionRoles::new_custom_perms() and provide a handler for updating custom permission roles. You will want to set a default PermissionLimit for each channel and also provide a sane default for any existing connections. You may or may not wish to provide a default auto permission. If in doubt, leave this alone as custom permissions by definition are the responsibility of the channel owner to manage. You just don't want to create any suprises or break things so you have an opportunity to provide sane settings.
Update the version here and in PermissionRoles.
Permissions with 'view' in the name are considered read permissions. Anything else requires authentication. Read permission limits are PERMS_PUBLIC and anything else is given PERMS_SPECIFIC.
PermissionLimits::Std_limits() retrieves the standard limits. A permission role MAY alter an individual setting after retrieving the Std_limits if you require something different for a specific permission within the given role.
|
static |
Perms from the above list that are blocked from anonymous observers.
e.g. you must be authenticated.
Referenced by get_all_perms(), and perm_is_allowed().
|
static |
int | $channel_id | A channel id |
Referenced by Zotlabs\Module\Defperms\get(), Zotlabs\Module\Connedit\get(), new_contact(), Zotlabs\Module\Connedit\post(), and zot_refresh().
|
static |
int | $channel_id |
Referenced by Zotlabs\Access\Permissions\connect_perms(), and zotinfo().
|
static |
Converts indexed perms array to associative perms array.
Converts [ 0 => 'view_stream', ... ] to [ 'view_stream' => 1 ] for any permissions in $arr; Undeclared permissions which exist in Perms() are added and set to 0.
array | $arr |
Referenced by Zotlabs\Lib\Permcat\__construct(), Zotlabs\Access\Permissions\connect_perms(), create_identity(), and Zotlabs\Module\Settings\Channel\post().
|
static |
Convert perms array to indexed array.
Converts [ 'view_stream' => 1 ] for any permissions in $arr to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
array | $arr | associative perms array 'view_stream' => 1 |
|
static |
Return an array with Permissions.
string | $filter | (optional) only passed to hook permissions_list |
Referenced by Zotlabs\Lib\PermissionDescription\fromGlobalPermission(), Zotlabs\Module\Settings\Permcats\get(), Zotlabs\Module\Settings\Tokens\get(), Zotlabs\Module\Defperms\get(), Zotlabs\Module\Settings\Channel\get(), Zotlabs\Module\Connedit\get(), get_all_api_perms(), get_all_perms(), perm_is_allowed(), Zotlabs\Module\Settings\Permcats\post(), Zotlabs\Module\Settings\Tokens\post(), Zotlabs\Module\Settings\Channel\post(), Zotlabs\Module\Defperms\post(), Zotlabs\Module\Connedit\post(), site_default_perms(), and Zotlabs\Access\PermissionLimits\Std_Limits().
|
static |
Compares that all Permissions from $p1 exist also in $p2.
array | $p1 | The perms that have to exist in $p2 |
array | $p2 | The perms to compare against |
|
static |
Permissions version.
This must match the version in PermissionRoles.php before permission updates can run.