public function clearUserCachedPerms($userId)
    {
        $cache = $this->getCache();
        
        $ids = $cache->getIds();
        foreach ($ids as $id) {
            // get the item, see if it has the user ID
            if ($id == self::SOURCES_MAP || strpos($id, 'source_') !== false || strpos($id, self::ITEM_PREFIX) === false) {
                continue;
            }

            $userPerms = $cache->load($id);
            if (is_array($userPerms)) {
                $changed = false;
                foreach ($userPerms as $type => $grantedUserIds) {
                    $newIds = array();
                    foreach ($grantedUserIds as $grantedUserId => $grant) {
                        if ($userId != $grantedUserId) {
                            $newIds[$grantedUserId] = $grant;
                        }
                    }
                    if (count($newIds) != count($userPerms[$type])) {
                        $userPerms[$type] = $newIds;
                        $changed = true;
                    }
                }
                if ($changed) {
                    $cache->save($userPerms, $id);
                }
            }
        }
    }
public function clearUserCachedPerms($userId)
    {
        $cache = $this->getCache();
        
        $ids = $cache->getIds();
        foreach ($ids as $id) {
            // get the item, see if it has the user ID
            if ($id == self::SOURCES_MAP || strpos($id, 'source_') !== false || strpos($id, self::ITEM_PREFIX) === false) {
                continue;
            }

            $userPerms = $cache->load($id);
            if (is_array($userPerms)) {
                $changed = false;
                foreach ($userPerms as $type => $grantedUserIds) {
                    $newIds = array();
                    foreach ($grantedUserIds as $grantedUserId => $grant) {
                        if ($userId != $grantedUserId) {
                            $newIds[$grantedUserId] = $grant;
                        }
                    }
                    if (count($newIds) != count($userPerms[$type])) {
                        $userPerms[$type] = $newIds;
                        $changed = true;
                    }
                }
                if ($changed) {
                    $cache->save($userPerms, $id);
                }
            }
        }
    }
public function clearUserCachedPerms ( $ userId ) { $ cache = $ this -> getCache ( ) ; $ ids = $ cache -> getIds ( ) ; foreach ( $ ids as $ id ) { // get the item, see if it has the user ID if ( $ id == self :: SOURCES_MAP || strpos ( $ id , 'source_' ) !== false || strpos ( $ id , self :: ITEM_PREFIX ) === false ) { continue ; } $ userPerms = $ cache -> load ( $ id ) ; if ( is_array ( $ userPerms ) ) { $ changed = false ; foreach ( $ userPerms as $ type => $ grantedUserIds ) { $ newIds = array ( ) ; foreach ( $ grantedUserIds as $ grantedUserId => $ grant ) { if ( $ userId != $ grantedUserId ) { $ newIds [ $ grantedUserId ] = $ grant ; } } if ( count ( $ newIds ) != count ( $ userPerms [ $ type ] ) ) { $ userPerms [ $ type ] = $ newIds ; $ changed = true ; } } if ( $ changed ) { $ cache -> save ( $ userPerms , $ id ) ; } } } }
Clear all cached permissions for the given user

@param int $userId
Clear all cached permissions for the given user