public function hasPrivileges(User $user, array $required) {
        foreach ($required as $resourceId=>$right) {
            if ($right === 'WRITE' && !$this->hasWritePrivilege($user, $resourceId)) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have lock for resource \''.$resourceId.'\'');
                return false;
            }
            if (!in_array($right, $this->getPermissionProvider()->getSupportedRights())) {
                $required[$resourceId] = PermissionInterface::RIGHT_UNSUPPORTED;
            }
        }
        
        $permissions = $this->getPermissionProvider()->getPermissions($user, array_keys($required));
        foreach ($required as $id => $right) {
            if (!isset($permissions[$id]) || !in_array($right, $permissions[$id])) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have \''.$right.'\' permission for resource \''.$id.'\'');
                return false;
            }
        }
        return true;
    }
public function hasPrivileges(User $user, array $required) {
        foreach ($required as $resourceId=>$right) {
            if ($right === 'WRITE' && !$this->hasWritePrivilege($user, $resourceId)) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have lock for resource \''.$resourceId.'\'');
                return false;
            }
            if (!in_array($right, $this->getPermissionProvider()->getSupportedRights())) {
                $required[$resourceId] = PermissionInterface::RIGHT_UNSUPPORTED;
            }
        }
        
        $permissions = $this->getPermissionProvider()->getPermissions($user, array_keys($required));
        foreach ($required as $id => $right) {
            if (!isset($permissions[$id]) || !in_array($right, $permissions[$id])) {
                common_Logger::d('User \''.$user->getIdentifier().'\' does not have \''.$right.'\' permission for resource \''.$id.'\'');
                return false;
            }
        }
        return true;
    }
public function hasPrivileges ( User $ user , array $ required ) { foreach ( $ required as $ resourceId => $ right ) { if ( $ right === 'WRITE' && ! $ this -> hasWritePrivilege ( $ user , $ resourceId ) ) { common_Logger :: d ( 'User \'' . $ user -> getIdentifier ( ) . '\' does not have lock for resource \'' . $ resourceId . '\'' ) ; return false ; } if ( ! in_array ( $ right , $ this -> getPermissionProvider ( ) -> getSupportedRights ( ) ) ) { $ required [ $ resourceId ] = PermissionInterface :: RIGHT_UNSUPPORTED ; } } $ permissions = $ this -> getPermissionProvider ( ) -> getPermissions ( $ user , array_keys ( $ required ) ) ; foreach ( $ required as $ id => $ right ) { if ( ! isset ( $ permissions [ $ id ] ) || ! in_array ( $ right , $ permissions [ $ id ] ) ) { common_Logger :: d ( 'User \'' . $ user -> getIdentifier ( ) . '\' does not have \'' . $ right . '\' permission for resource \'' . $ id . '\'' ) ; return false ; } } return true ; }
Whenever or not the user has the required rights

required takes the form of:
resourceId => $right

@param User $user
@param array $required
@return boolean
Whenever or not the user has the required rights