Skip to content

Instantly share code, notes, and snippets.

@ahmad-moussawi
Created May 5, 2014 12:26
Show Gist options
  • Save ahmad-moussawi/672f855c5f2e5deaf7e1 to your computer and use it in GitHub Desktop.
Save ahmad-moussawi/672f855c5f2e5deaf7e1 to your computer and use it in GitHub Desktop.
<?php
return array(
'123456',
'1234567',
'12345678'
);
<?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