PHP Interface Imbo\Auth\AccessControl\Adapter\AdapterInterface

Author: Espen Hovlandsdal ([email protected])
Show file Open project: imbo/imbo

Public Methods

Method Description
getAccessListForPublicKey ( string $publicKey ) : array Get the access control list for a given public key
getAccessRule ( string $publicKey, array $accessRuleId ) : array Get an access rule by id
getGroup ( string $groupName ) : array Fetch a resource group with the given name
getGroups ( Imbo\Auth\AccessControl\GroupQuery $query = null, Groups $model ) : array Fetch a list of available resource groups
getPrivateKey ( string $publicKey ) : string Return the private key for a given public key
getUsersForResource ( string $publicKey, string $resource ) : array Get a list of users the public key has access for on a given resource
groupExists ( string $groupName ) : boolean Check whether or not a group exists
hasAccess ( string $publicKey, string $resource, string $user = null ) : boolean Check if a given public key has access to a given resource
publicKeyExists ( string $publicKey ) : boolean Get whether a public key exists or not

Method Details

getAccessListForPublicKey() public method

Get the access control list for a given public key
public getAccessListForPublicKey ( string $publicKey ) : array
$publicKey string
return array

getAccessRule() public method

Get an access rule by id
public getAccessRule ( string $publicKey, array $accessRuleId ) : array
$publicKey string Public key to add access rule to
$accessRuleId array Access rule id
return array Access rule

getGroup() public method

Fetch a resource group with the given name
public getGroup ( string $groupName ) : array
$groupName string Name of the group
return array Array of resources the group consists of

getGroups() public method

Fetch a list of available resource groups
public getGroups ( Imbo\Auth\AccessControl\GroupQuery $query = null, Groups $model ) : array
$query Imbo\Auth\AccessControl\GroupQuery A query object used to filter the groups returned
$model Imbo\Model\Groups Groups model to populate total number of hits with
return array

getPrivateKey() public method

Return the private key for a given public key
public getPrivateKey ( string $publicKey ) : string
$publicKey string The public key to fetch matching private key for
return string Returns the private key for the public key

getUsersForResource() public method

Get a list of users the public key has access for on a given resource
public getUsersForResource ( string $publicKey, string $resource ) : array
$publicKey string Public key to check access for
$resource string Resource identifier (e.g. image.get, images.post)
return array List of users the public key kan access the given resource for

groupExists() public method

Check whether or not a group exists
public groupExists ( string $groupName ) : boolean
$groupName string Name of the group
return boolean

hasAccess() public method

Check if a given public key has access to a given resource
public hasAccess ( string $publicKey, string $resource, string $user = null ) : boolean
$publicKey string Public key to check access for
$resource string Resource identifier (e.g. image.get, images.post)
$user string Optional user which the resource belongs to
return boolean True if public key has access, false otherwise

publicKeyExists() public method

Get whether a public key exists or not
public publicKeyExists ( string $publicKey ) : boolean
$publicKey string Public key to check
return boolean