PHP Class ZF\Apigility\Admin\Model\AuthorizationModel

Mostrar archivo Open project: zfcampus/zf-apigility-admin

Protected Properties

Property Type Description
$configResource ZF\Configuration\ConfigResource
$module string
$moduleEntity ModuleEntity
$modulePath string
$modules ModulePathSpec

Public Methods

Method 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

Protected Methods

Method 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 method

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

createDefaultPrivileges() protected method

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

createDefaultPrivilegesForRestServices() protected method

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 method

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 method

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
return string

fetch() public method

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

filterServicesByVersion() protected method

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

getBaseServiceNamesFromEntity() protected method

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

injectServicesWithoutPrivileges() protected method

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 method

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

remapServiceNamesForStorage() protected method

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

update() public method

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

Property Details

$configResource protected_oe property

protected ConfigResource,ZF\Configuration $configResource
return ZF\Configuration\ConfigResource

$module protected_oe property

protected string $module
return string

$moduleEntity protected_oe property

protected ModuleEntity,ZF\Apigility\Admin\Model $moduleEntity
return ModuleEntity

$modulePath protected_oe property

protected string $modulePath
return string

$modules protected_oe property

protected ModulePathSpec $modules
return ModulePathSpec