public function getResourcesPermissions(User $user, $resources)
    {
        $permissions = [];
        if(!is_null($user)){
            try {
                $permissionManager = $this->getServiceManager()->get(PermissionInterface::SERVICE_ID);
                $supportedRights   = $permissionManager->getSupportedRights();
                $permissions['supportedRights'] = $supportedRights;

                if(count($supportedRights) > 0){
                    $uris = $this->getUris($resources);

                    $permissions['data'] = $permissionManager->getPermissions($user, $uris);
                }
            } catch(\Exception $e){
                \common_Logger::w('Unable to retrieve permssions ' . $e->getMessage());
            }
        }
        return $permissions;

    }
public function getResourcesPermissions(User $user, $resources)
    {
        $permissions = [];
        if(!is_null($user)){
            try {
                $permissionManager = $this->getServiceManager()->get(PermissionInterface::SERVICE_ID);
                $supportedRights   = $permissionManager->getSupportedRights();
                $permissions['supportedRights'] = $supportedRights;

                if(count($supportedRights) > 0){
                    $uris = $this->getUris($resources);

                    $permissions['data'] = $permissionManager->getPermissions($user, $uris);
                }
            } catch(\Exception $e){
                \common_Logger::w('Unable to retrieve permssions ' . $e->getMessage());
            }
        }
        return $permissions;

    }
public function getResourcesPermissions ( User $ user , $ resources ) { $ permissions = [ ] ; if ( ! is_null ( $ user ) ) { try { $ permissionManager = $ this -> getServiceManager ( ) -> get ( PermissionInterface :: SERVICE_ID ) ; $ supportedRights = $ permissionManager -> getSupportedRights ( ) ; $ permissions [ 'supportedRights' ] = $ supportedRights ; if ( count ( $ supportedRights ) > 0 ) { $ uris = $ this -> getUris ( $ resources ) ; $ permissions [ 'data' ] = $ permissionManager -> getPermissions ( $ user , $ uris ) ; } } catch ( \ Exception $ e ) { \ common_Logger :: w ( 'Unable to retrieve permssions ' . $ e -> getMessage ( ) ) ; } } return $ permissions ; }
Get the permissions for a list of resources.

@param User $user the user to check the permissions
@param array $resources the resources to get the permissions
@return array the available rights and the permissions per resource
Get the permissions for a list of resources .