diff options
author | zotlabs <mike@macgirvin.com> | 2017-01-24 16:00:58 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-01-24 16:00:58 -0800 |
commit | dad83977635bd01690b3ee15e1646de9c61c8d4e (patch) | |
tree | a8dddcbce6210fc8f62b41669182629fb138eb61 /Zotlabs | |
parent | c8239c739d08093b3e777b66a06e13290981ae9e (diff) | |
download | volse-hubzilla-dad83977635bd01690b3ee15e1646de9c61c8d4e.tar.gz volse-hubzilla-dad83977635bd01690b3ee15e1646de9c61c8d4e.tar.bz2 volse-hubzilla-dad83977635bd01690b3ee15e1646de9c61c8d4e.zip |
initial selections for extensible permission categories ("permcats")
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Access/PermissionRoles.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Zotlabs/Access/PermissionRoles.php b/Zotlabs/Access/PermissionRoles.php index 94c49c44f..f21025442 100644 --- a/Zotlabs/Access/PermissionRoles.php +++ b/Zotlabs/Access/PermissionRoles.php @@ -256,5 +256,47 @@ class PermissionRoles { } + static public function permcats($uid) { + + $permcats = [ + [ 'follower', t('follower','permcat'), + [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', + 'post_like' ] + ], + + [ 'contributor', t('contributor','permcat'), + [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', + 'post_wall','post_comments','post_like','tag_deliver','chat' ] + ], + [ 'trusted', t('trusted','permcat'), + [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', + 'write_storage','post_wall','post_comments','post_like','tag_deliver', + 'chat', 'republish' ] + ], + [ 'moderator', t('moderator','permcat'), + [ 'view_stream','view_profile','view_contacts','view_storage','view_pages', + 'write_storage','post_wall','post_comments','post_like','tag_deliver', + 'chat', 'republish' ] + ] + ]; + + if($uid) { + $x = q("select * from pconfig where uid = %d and cat = 'permcat'", + intval($uid) + ); + if($x) { + foreach($x as $xv) { + $permcats[] = [ $xv['k'], $xv['k'], $xv['v'] ]; + } + } + } + + call_hooks('permcats',$permcats); + + return $permcats; + + } + + }
\ No newline at end of file |