PHP Class Imbo\Auth\AccessControl\Adapter\Mongo

Valid parameters for this driver: - (string) databaseName Name of the database. Defaults to 'imbo' - (string) server The server string to use when connecting to MongoDB. Defaults to 'mongodb://localhost:27017' - (array) options Options to use when creating the MongoClient instance. Defaults to ['connect' => true, 'connectTimeoutMS' => 1000].
Author: Espen Hovlandsdal ([email protected])
Author: Kristoffer Brabrand ([email protected])
Inheritance: extends AbstractAdapter, implements Imbo\Auth\AccessControl\Adapter\MutableAdapterInterface
Show file Open project: imbo/imbo

Public Methods

Method Description
__construct ( array $params = null, MongoDB\Client $client = null, MongoDB\Collection $aclCollection = null, MongoDB\Collection $aclGroupCollection = null, BSONToArray $bsonToArray = null ) Class constructor
addAccessRule ( $publicKey, array $accessRule )
addKeyPair ( $publicKey, $privateKey )
addResourceGroup ( $groupName, array $resources = [] )
deleteAccessRule ( $publicKey, $accessId )
deletePublicKey ( $publicKey )
deleteResourceGroup ( $groupName )
getAccessListForPublicKey ( $publicKey )
getAccessRule ( $publicKey, $accessId )
getGroup ( $groupName )
getGroups ( Imbo\Auth\AccessControl\GroupQuery $query = null, Groups $model )
getPrivateKey ( $publicKey )
groupExists ( $groupName )
publicKeyExists ( $publicKey )
updatePrivateKey ( $publicKey, $privateKey )
updateResourceGroup ( $groupName, array $resources )

Private Methods

Method Description
getAclCollection ( ) : MongoDB\Collection Get the ACL mongo collection
getGroupsCollection ( ) : MongoDB\Collection Get the resource groups mongo collection
getMongoClient ( ) : MongoDB\Client Get the mongo client instance
getPublicKeyDetails ( string $publicKey ) : array Get details for a given public key

Method Details

__construct() public method

Class constructor
public __construct ( array $params = null, MongoDB\Client $client = null, MongoDB\Collection $aclCollection = null, MongoDB\Collection $aclGroupCollection = null, BSONToArray $bsonToArray = null )
$params array Parameters for the driver
$client MongoDB\Client MongoClient instance
$aclCollection MongoDB\Collection MongoCollection instance for the acl collection
$aclGroupCollection MongoDB\Collection
$bsonToArray Imbo\Helpers\BSONToArray BSONToArray helper

addAccessRule() public method

public addAccessRule ( $publicKey, array $accessRule )
$accessRule array

addKeyPair() public method

public addKeyPair ( $publicKey, $privateKey )

addResourceGroup() public method

public addResourceGroup ( $groupName, array $resources = [] )
$resources array

deleteAccessRule() public method

public deleteAccessRule ( $publicKey, $accessId )

deletePublicKey() public method

public deletePublicKey ( $publicKey )

deleteResourceGroup() public method

public deleteResourceGroup ( $groupName )

getAccessListForPublicKey() public method

public getAccessListForPublicKey ( $publicKey )

getAccessRule() public method

public getAccessRule ( $publicKey, $accessId )

getGroup() public method

public getGroup ( $groupName )

getGroups() public method

public getGroups ( Imbo\Auth\AccessControl\GroupQuery $query = null, Groups $model )
$query Imbo\Auth\AccessControl\GroupQuery
$model Imbo\Model\Groups

getPrivateKey() public method

public getPrivateKey ( $publicKey )

groupExists() public method

public groupExists ( $groupName )

publicKeyExists() public method

public publicKeyExists ( $publicKey )

updatePrivateKey() public method

public updatePrivateKey ( $publicKey, $privateKey )

updateResourceGroup() public method

public updateResourceGroup ( $groupName, array $resources )
$resources array