aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Access/PermissionRoles.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-27 04:44:10 -0700
committerredmatrix <git@macgirvin.com>2016-06-27 04:44:10 -0700
commit17e161006a9ddbfbea3e0b6d5f7776ad7b8101e2 (patch)
tree086c8e49e35f86373f11c00557183ea8e0db51f1 /Zotlabs/Access/PermissionRoles.php
parent85d2ad4aea106417dc3d8ce2429d13dd858c5201 (diff)
downloadvolse-hubzilla-17e161006a9ddbfbea3e0b6d5f7776ad7b8101e2.tar.gz
volse-hubzilla-17e161006a9ddbfbea3e0b6d5f7776ad7b8101e2.tar.bz2
volse-hubzilla-17e161006a9ddbfbea3e0b6d5f7776ad7b8101e2.zip
added permissionroles
Diffstat (limited to 'Zotlabs/Access/PermissionRoles.php')
-rw-r--r--Zotlabs/Access/PermissionRoles.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/Zotlabs/Access/PermissionRoles.php b/Zotlabs/Access/PermissionRoles.php
new file mode 100644
index 000000000..32a72d3ae
--- /dev/null
+++ b/Zotlabs/Access/PermissionRoles.php
@@ -0,0 +1,70 @@
+<?php
+
+
+namespace Zotlabs\Access;
+
+use Zotlabs\Lib as Zlib;
+
+class PermissionRoles {
+
+ static private role_limits = array();
+ static private role_perms = array();
+
+ static public function roles() {
+ $roles = [
+ t('Social Networking') => [
+ 'social' => t('Social - Mostly Public'),
+ 'social_restricted' => t('Social - Restricted'),
+ 'social_private' => t('Social - Private')
+ ],
+
+ t('Community Forum') => [
+ 'forum' => t('Forum - Mostly Public'),
+ 'forum_restricted' => t('Forum - Restricted'),
+ 'forum_private' => t('Forum - Private')
+ ],
+
+ t('Feed Republish') => [
+ 'feed' => t('Feed - Mostly Public'),
+ 'feed_restricted' => t('Feed - Restricted')
+ ],
+
+ t('Special Purpose') => [
+ 'soapbox' => t('Special - Celebrity/Soapbox'),
+ 'repository' => t('Special - Group Repository')
+ ],
+
+ t('Other') => [
+ 'custom' => t('Custom/Expert Mode')
+ ]
+
+ ];
+
+ return $roles;
+ }
+
+
+ static public function LimitSet($permission,$limit,$roles) {
+ if(is_array($roles)) {
+ foreach($roles as $role) {
+ self::$role_limits[$role][$permission] = $limit;
+ }
+ }
+ else {
+ self::$role_limits[$role][$permission] = $limit;
+ }
+ }
+
+ static public function PermSet($permission,$roles) {
+ if(is_array($roles)) {
+ foreach($roles as $role) {
+ self::$role_perms[$role][] = $permission;
+ }
+ }
+ else {
+ self::$role_perms[$role][] = $permission;
+ }
+ }
+
+
+} \ No newline at end of file