versioning for permission additions to ensure we're using the same set of files
This commit is contained in:
parent
97e70d62bf
commit
73876e5774
@ -7,6 +7,9 @@ use Zotlabs\Lib as Zlib;
|
|||||||
|
|
||||||
class PermissionRoles {
|
class PermissionRoles {
|
||||||
|
|
||||||
|
static public function version() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static function role_perms($role) {
|
static function role_perms($role) {
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ class Permissions {
|
|||||||
* are the responsbility of the channel owner to manage. You just don't want to create any
|
* are the responsbility 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.
|
* 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
|
* Permissions with 'view' in the name are considered read permissions. Anything
|
||||||
* else requires authentication. Read permission limits are PERMS_PUBLIC and anything else
|
* else requires authentication. Read permission limits are PERMS_PUBLIC and anything else
|
||||||
@ -32,6 +34,10 @@ class Permissions {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static public function version() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static public function Perms($filter = '') {
|
static public function Perms($filter = '') {
|
||||||
|
|
||||||
|
5
boot.php
5
boot.php
@ -2454,6 +2454,11 @@ function cert_bad_email() {
|
|||||||
|
|
||||||
function check_for_new_perms() {
|
function check_for_new_perms() {
|
||||||
|
|
||||||
|
// Do not execute if we are in the middle of a git update and the relevant versions don't match
|
||||||
|
|
||||||
|
if( \Zotlabs\Access\Permissions::version() != \Zotlabs\Access\PermissionRoles::version())
|
||||||
|
return;
|
||||||
|
|
||||||
$pregistered = get_config('system','perms');
|
$pregistered = get_config('system','perms');
|
||||||
$pcurrent = array_keys(\Zotlabs\Access\Permissions::Perms());
|
$pcurrent = array_keys(\Zotlabs\Access\Permissions::Perms());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user