Created
May 5, 2014 12:26
-
-
Save ahmad-moussawi/672f855c5f2e5deaf7e1 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 | |
return array( | |
'123456', | |
'1234567', | |
'12345678' | |
); |
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 Permission | |
{ | |
static $dictionaryPath = 'clients.php'; | |
/** | |
* Check if the clientId exists in the dictionary | |
* @param $clientId | |
* return (boolean) true if exists, false otherwise | |
*/ | |
public static function check($clientId) { | |
return in_array($clientId, self::_getAvailableClients()); | |
} | |
private static function _getAvailableClients(){ | |
return require __DIR__ . DIRECTORY_SEPERATOR . static::$dictionaryPath; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment