Monday, June 30, 2008
RN - Permissions Refactor
I refactored permissions again. This will really only affect developers and users shouldn't notice a difference. In common.php permissions are set by $permissions = new Permissions(); And now calls to get permissions look like this: $permission->isAdmin(true); Where the boolean passed it determines if the user should be booted if they don't have the permission. If you pass in false the function will return a boolean telling if the user has the permission. To check for multiple permissions on a page call $permissions->checkForPermissions(array('admin_group_add', 'admin_group_edit', 'admin_group_delete')); This function will boot the user if they don't have one of the permissions defined.
I have refactored the permissions page and the group pages to use this new system. Right now all other admin pages check for $permissions->isAdmin(true);