aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-24 16:00:58 -0800
committerzotlabs <mike@macgirvin.com>2017-01-24 16:00:58 -0800
commitdad83977635bd01690b3ee15e1646de9c61c8d4e (patch)
treea8dddcbce6210fc8f62b41669182629fb138eb61 /Zotlabs
parentc8239c739d08093b3e777b66a06e13290981ae9e (diff)
downloadvolse-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.php42
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