public function removeCapabilities($userLogin, $capabilities, $idSites)
    {
        $idSites = $this->getIdSitesCheckAdminAccess($idSites);

        $this->checkUserExists($userLogin);

        if (!is_array($capabilities)){
            $capabilities = array($capabilities);
        }

        foreach ($capabilities as $capability) {
            $this->capabilityProvider->checkValidCapability($capability);
        }

        foreach ($capabilities as $capability) {
            $this->model->removeUserAccess($userLogin, $capability, $idSites);
        }

        // we reload the access list which doesn't yet take in consideration this removed capability
        $this->reloadPermissions();
    }
public function removeCapabilities($userLogin, $capabilities, $idSites)
    {
        $idSites = $this->getIdSitesCheckAdminAccess($idSites);

        $this->checkUserExists($userLogin);

        if (!is_array($capabilities)){
            $capabilities = array($capabilities);
        }

        foreach ($capabilities as $capability) {
            $this->capabilityProvider->checkValidCapability($capability);
        }

        foreach ($capabilities as $capability) {
            $this->model->removeUserAccess($userLogin, $capability, $idSites);
        }

        // we reload the access list which doesn't yet take in consideration this removed capability
        $this->reloadPermissions();
    }
public function removeCapabilities ( $ userLogin , $ capabilities , $ idSites ) { $ idSites = $ this -> getIdSitesCheckAdminAccess ( $ idSites ) ; $ this -> checkUserExists ( $ userLogin ) ; if ( ! is_array ( $ capabilities ) ) { $ capabilities = array ( $ capabilities ) ; } foreach ( $ capabilities as $ capability ) { $ this -> capabilityProvider -> checkValidCapability ( $ capability ) ; } foreach ( $ capabilities as $ capability ) { $ this -> model -> removeUserAccess ( $ userLogin , $ capability , $ idSites ) ; } // we reload the access list which doesn't yet take in consideration this removed capability $ this -> reloadPermissions ( ) ; }
Removes the given capabilities from the given user for the given sites.
The capability will be only removed if it is actually granted as a separate capability. If the user has a role
that includes a specific capability, for example "Admin", then the capability will not be removed because the
assigned role will always include this capability.

@param string $userLogin The user login
@param string|string[] $capabilities  To fetch a list of available capabilities call "UsersManager.getAvailableCapabilities".
@param int|int[] $idSites
@throws Exception
Removes the given capabilities from the given user for the given sites . The capability will be only removed if it is actually granted as a separate capability . If the user has a role that includes a specific capability for example Admin then the capability will not be removed because the assigned role will always include this capability .