-
-
Save sevein/417917c79764f0b60b60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SecurityPrivileges | |
{ | |
public static | |
$map = array( | |
'informatinObject' => array('administrator', 'editor', 'contributor', 'translator'), | |
'actor' => array('administrator', 'editor', 'contributor', 'translator'), | |
'repository' => array('administrator', 'editor', 'contributor', 'translator'), | |
'term' => array('administrator', 'editor', 'translator')); | |
public static function editCredentials($user, $object) | |
{ | |
// Should we return false instead? | |
if (!isset(self::$map[$object])) | |
{ | |
return; | |
} | |
return $user->hasCredential($map[$object], false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment