PHP Class ZF\Apigility\Admin\Model\AuthorizationModel

Afficher le fichier Open project: zfcampus/zf-apigility-admin

Protected Properties

Свойство Type Description
$configResource ZF\Configuration\ConfigResource
$module string
$moduleEntity ModuleEntity
$modulePath string
$modules ModulePathSpec

Méthodes publiques

Méthode Description
__construct ( ModuleEntity $moduleEntity, ModulePathSpec $modules, ZF\Configuration\ConfigResource $config )
fetch ( integer $version = 1 ) : AuthorizationEntity Fetch authorization list for a given module by version
update ( array $privileges, integer $version = 1 ) : AuthorizationEntity Update the authorization list for a given module by version

Méthodes protégées

Méthode Description
createDefaultPrivileges ( integer $version, array $config ) : AuthorizationEntity Create default privileges for all services of a specific version in the module
createDefaultPrivilegesForRestServices ( array $services, AuthorizationEntity $entity, integer $version ) Create default privileges for a list of REST services of the specified version
createDefaultPrivilegesForRpcServices ( array $services, AuthorizationEntity $entity, array $config, integer $version ) Create default privileges for a list of RPC services of the specified version
discoverActionForRpcService ( string $serviceName, array $serviceConfig, array $config ) : string Attempt to identify the action associated with an RPC service
filterServicesByVersion ( array $config, integer $version ) : array Removes any services that do not match the current version
getBaseServiceNamesFromEntity ( AuthorizationEntity $entity ) : array Determine the base service name for authorization service keys
injectServicesWithoutPrivileges ( AuthorizationEntity $entity, integer $version, array $config ) Identify services in the current version without authorization configuration and inject them into the entity
remapServiceNamesForPayload ( array $config ) : array Translate service names to match the payload expectations.
remapServiceNamesForStorage ( array $config ) : array Translate service names to match the storage expectations.

Method Details

__construct() public méthode

public __construct ( ModuleEntity $moduleEntity, ModulePathSpec $modules, ZF\Configuration\ConfigResource $config )
$moduleEntity ModuleEntity
$modules ModulePathSpec
$config ZF\Configuration\ConfigResource

createDefaultPrivileges() protected méthode

Create default privileges for all services of a specific version in the module
protected createDefaultPrivileges ( integer $version, array $config ) : AuthorizationEntity
$version integer
$config array
Résultat AuthorizationEntity

createDefaultPrivilegesForRestServices() protected méthode

Create default privileges for a list of REST services of the specified version
protected createDefaultPrivilegesForRestServices ( array $services, AuthorizationEntity $entity, integer $version )
$services array
$entity AuthorizationEntity
$version integer

createDefaultPrivilegesForRpcServices() protected méthode

Create default privileges for a list of RPC services of the specified version
protected createDefaultPrivilegesForRpcServices ( array $services, AuthorizationEntity $entity, array $config, integer $version )
$services array
$entity AuthorizationEntity
$config array Used to determine action associated with RPC service (via route config)
$version integer

discoverActionForRpcService() protected méthode

Looks for an "action" default in the route options associated with the RPC service. If no route name is provided, or no "action" default is found, returns "index".
protected discoverActionForRpcService ( string $serviceName, array $serviceConfig, array $config ) : string
$serviceName string
$serviceConfig array
$config array
Résultat string

fetch() public méthode

Fetch authorization list for a given module by version
public fetch ( integer $version = 1 ) : AuthorizationEntity
$version integer
Résultat AuthorizationEntity

filterServicesByVersion() protected méthode

Removes any services that do not match the current version
protected filterServicesByVersion ( array $config, integer $version ) : array
$config array
$version integer
Résultat array

getBaseServiceNamesFromEntity() protected méthode

Determine the base service name for authorization service keys
protected getBaseServiceNamesFromEntity ( AuthorizationEntity $entity ) : array
$entity AuthorizationEntity
Résultat array

injectServicesWithoutPrivileges() protected méthode

Identify services in the current version without authorization configuration and inject them into the entity
protected injectServicesWithoutPrivileges ( AuthorizationEntity $entity, integer $version, array $config )
$entity AuthorizationEntity
$version integer
$config array

remapServiceNamesForPayload() protected méthode

Translate service names to match the payload expectations.
protected remapServiceNamesForPayload ( array $config ) : array
$config array
Résultat array

remapServiceNamesForStorage() protected méthode

Translate service names to match the storage expectations.
protected remapServiceNamesForStorage ( array $config ) : array
$config array
Résultat array

update() public méthode

Update the authorization list for a given module by version
public update ( array $privileges, integer $version = 1 ) : AuthorizationEntity
$privileges array
$version integer
Résultat AuthorizationEntity

Property Details

$configResource protected_oe property

protected ConfigResource,ZF\Configuration $configResource
Résultat ZF\Configuration\ConfigResource

$module protected_oe property

protected string $module
Résultat string

$moduleEntity protected_oe property

protected ModuleEntity,ZF\Apigility\Admin\Model $moduleEntity
Résultat ModuleEntity

$modulePath protected_oe property

protected string $modulePath
Résultat string

$modules protected_oe property

protected ModulePathSpec $modules
Résultat ModulePathSpec