diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-07-21 21:14:54 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-07-21 21:14:54 -0400 |
commit | 5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6 (patch) | |
tree | 84b9b847f384c42a462a0035142b4b5757906922 /Zotlabs/Access/PermissionLimits.php | |
parent | d504197a786eb46a780278fccb529daa13bfa443 (diff) | |
parent | 8566f9130395ecdbe19f9fce85a26dac39d9fe24 (diff) | |
download | volse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.tar.gz volse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.tar.bz2 volse-hubzilla-5a63ddd6457ae4dba61ff30db5b6601b22ddd1b6.zip |
Merge remote-tracking branch 'upstream/dev' into website-import
Diffstat (limited to 'Zotlabs/Access/PermissionLimits.php')
-rw-r--r-- | Zotlabs/Access/PermissionLimits.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Zotlabs/Access/PermissionLimits.php b/Zotlabs/Access/PermissionLimits.php new file mode 100644 index 000000000..909b654d5 --- /dev/null +++ b/Zotlabs/Access/PermissionLimits.php @@ -0,0 +1,36 @@ +<?php + +namespace Zotlabs\Access; + +use \Zotlabs\Lib as ZLib; + +class PermissionLimits { + + static public function Std_Limits() { + $perms = Permissions::Perms(); + $limits = array(); + foreach($perms as $k => $v) { + if(strstr($k,'view')) + $limits[$k] = PERMS_PUBLIC; + else + $limits[$k] = PERMS_SPECIFIC; + } + return $limits; + } + + static public function Set($channel_id,$perm,$perm_limit) { + ZLib\PConfig::Set($channel_id,'perm_limits',$perm,$perm_limit); + } + + static public function Get($channel_id,$perm = '') { + if($perm) { + return Zlib\PConfig::Get($channel_id,'perm_limits',$perm); + } + else { + Zlib\PConfig::Load($channel_id); + if(array_key_exists($channel_id,\App::$config) && array_key_exists('perm_limits',\App::$config[$channel_id])) + return \App::$config[$channel_id]['perm_limits']; + return false; + } + } +}
\ No newline at end of file |