public static function getCapabilitiesForAction(Table $table, string $contrName, array $actions): array
    {
        $result = [];

        if (empty($contrName) || empty($actions)) {
            return $result;
        }

        $contrName = static::generateCapabilityControllerName($contrName);

        $fullCapabilities = static::generateFullCapabilities($contrName, $actions);
        if (!empty($fullCapabilities)) {
            $result[static::CAP_TYPE_FULL] = $fullCapabilities;
        }

        $ownerCapabilities = static::generateOwnerCapabilities($table, $contrName, $actions);
        if (!empty($ownerCapabilities)) {
            $result[static::CAP_TYPE_OWNER] = $ownerCapabilities;
        }

        $parentCapabilities = static::generateParentCapabilities($table, $contrName, $actions);
        if (!empty($parentCapabilities)) {
            $result[static::CAP_TYPE_PARENT] = $parentCapabilities;
        }

        $belongsToCaps = static::generateBelongsToCapabilities($table, $contrName, $actions);
        if (!empty($belongsToCaps)) {
            $result[static::CAP_TYPE_BELONGS] = $belongsToCaps;
        }

        return $result;
    }
public static function getCapabilitiesForAction(Table $table, string $contrName, array $actions): array
    {
        $result = [];

        if (empty($contrName) || empty($actions)) {
            return $result;
        }

        $contrName = static::generateCapabilityControllerName($contrName);

        $fullCapabilities = static::generateFullCapabilities($contrName, $actions);
        if (!empty($fullCapabilities)) {
            $result[static::CAP_TYPE_FULL] = $fullCapabilities;
        }

        $ownerCapabilities = static::generateOwnerCapabilities($table, $contrName, $actions);
        if (!empty($ownerCapabilities)) {
            $result[static::CAP_TYPE_OWNER] = $ownerCapabilities;
        }

        $parentCapabilities = static::generateParentCapabilities($table, $contrName, $actions);
        if (!empty($parentCapabilities)) {
            $result[static::CAP_TYPE_PARENT] = $parentCapabilities;
        }

        $belongsToCaps = static::generateBelongsToCapabilities($table, $contrName, $actions);
        if (!empty($belongsToCaps)) {
            $result[static::CAP_TYPE_BELONGS] = $belongsToCaps;
        }

        return $result;
    }
public static function getCapabilitiesForAction ( Table $ table , string $ contrName , array $ actions ) : array { $ result = [ ] ; if ( empty ( $ contrName ) || empty ( $ actions ) ) { return $ result ; } $ contrName = static :: generateCapabilityControllerName ( $ contrName ) ; $ fullCapabilities = static :: generateFullCapabilities ( $ contrName , $ actions ) ; if ( ! empty ( $ fullCapabilities ) ) { $ result [ static :: CAP_TYPE_FULL ] = $ fullCapabilities ; } $ ownerCapabilities = static :: generateOwnerCapabilities ( $ table , $ contrName , $ actions ) ; if ( ! empty ( $ ownerCapabilities ) ) { $ result [ static :: CAP_TYPE_OWNER ] = $ ownerCapabilities ; } $ parentCapabilities = static :: generateParentCapabilities ( $ table , $ contrName , $ actions ) ; if ( ! empty ( $ parentCapabilities ) ) { $ result [ static :: CAP_TYPE_PARENT ] = $ parentCapabilities ; } $ belongsToCaps = static :: generateBelongsToCapabilities ( $ table , $ contrName , $ actions ) ; if ( ! empty ( $ belongsToCaps ) ) { $ result [ static :: CAP_TYPE_BELONGS ] = $ belongsToCaps ; } return $ result ; }
Method that generates capabilities for specified controller's actions.
Capabilities included are full or owner access types.

@param \Cake\ORM\Table $table Table instance
@param string $contrName Controller name
@param mixed[] $actions Controller actions
@return mixed[]
Method that generates capabilities for specified controller s actions . Capabilities included are full or owner access types .