/*
(non-Javadoc)

@see nyla.solutions.core.security.data.Acl#revokeAccess(java.security.
Principal, nyla.solutions.core.security.data.AccessControl)
171838
@Override
	public synchronized boolean revokeAccess(Principal caller, AccessControl aclEntry)
	{
		if (aclEntry == null)
			return false;

		Principal principal = aclEntry.getPrincipal();

		if (principal == null)
			return false;

		Set<AccessControl> set = this.entries.get(aclEntry.getPrincipal());
		if (set == null || set.isEmpty())
			return false;
		boolean r = set.remove(aclEntry);

		this.entries.put(principal, set);

		return r;
	}
1278527
public <R> R accessContext(ContextAccess<C,R> access)
    {
        contextLock.lock();
        try
        {
            return access.access(context);
        }
        finally
        {
            contextLock.unlock();
        }
    }
1027524
public function revokeSitePrivileges()
    {
        if ($this->revokeSiteStatement == null) {
            $this->revokeSiteStatement =
                $this->connection->prepare("DELETE FROM UserPrivileges WHERE username = ? AND sitePrivileges = 1");
            $u = $this->user->getUsername();
            $this->revokeSiteStatement->bindParam(1, $u);
        }
        $this->revokeSiteStatement->execute();
        $this->sitePrivilege = 0;
    }
998050
private void clearAuthorizationTable() {
        userToAccessId.clear();
        groupToAccessId.clear();
        userToRoles.clear();
        groupToRoles.clear();
        specialSubjectToRoles.clear();
        accessIdToRoles.clear();
        explicitAccessIdToRoles.clear();
    }
142318
public function revokePermission($accessEntityUuid, $accessEntityClass, $accessLevel)
    {
        return $this->permissionsDataSource->revokePermission($accessEntityUuid, $accessEntityClass, $accessLevel);
    }
448058
def revoke_user_access(self, instance, user, db_names, strict=True):
        
        return instance.revoke_user_access(user, db_names, strict=strict)
892884
public void accessRestriction_backupCode_DELETE() throws IOException {
		String qPath = "/me/accessRestriction/backupCode";
		StringBuilder sb = path(qPath);
		exec(qPath, "DELETE", sb.toString(), null);
	}
70239
public function revokeAccessToken()
    {
        //Access Token
        $accessToken = $this->getApp()->getAccessToken();

        //Request
        $request = new DropboxRequest("POST", "/auth/token/revoke", $accessToken);
        // Do not validate the response
        // since the /token/revoke endpoint
        // doesn't return anything in the response.
        // See: https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke
        $request->setParams(['validateResponse' => false]);

        //Revoke Access Token
        $this->getClient()->sendRequest($request);
    }
1294471
public function applyAccessRules()
    {
        foreach ($this->extension->getManifest()->getAclTable() as $tableEntry) {
            $rule = new AccessRule($tableEntry[0], $tableEntry[1], $tableEntry[2]);
            AclProxy::applyRule($rule);
        }
    }
1149794
@Override
	public void mergePermissions(AccessControl from, AccessControl to)
	{
		if (from == null || to == null)
			return;

		List<Permission> otherPermissions = from.getPermissions();

		if (otherPermissions == null)
			return;

		boolean changeNegative = from.isNegative() != to.isNegative();

		if (changeNegative)
			throw new SecurityException(
			"Cannot change or mixed different negative property for ACL from:" + from + " to ACL:" + to
			+ "  permission must be either all negative or all positive for a principal");

		Iterator<Permission> i = otherPermissions.iterator();

		while (i.hasNext())
		{

			to.addPermission(i.next());
		}
	}
417736
public static void endAccessContext() {
        AccessContext.clearAccessContextOnThread();
        final AccessContext accessContext = SuspendedAccessContext.getAccessContextOnThread();
        if (accessContext != null) { // resume
            AccessContext.setAccessContextOnThread(accessContext);
            SuspendedAccessContext.clearAccessContextOnThread();
        }
    }
810274
public void setAccessToken(final String accessToken, final Long expiresIn) {
    for (Authentication auth : authentications.values()) {
      if (auth instanceof OAuth) {
        ((OAuth) auth).setAccessToken(accessToken, expiresIn);
        return;
      }
    }
    OAuth oAuth = new OAuth(null, null, null) {
      @Override
      public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
        headerParams.put("Authorization", "Bearer " + accessToken);
      }
    };
    oAuth.setAccessToken(accessToken, expiresIn);
    addAuthorization("docusignAccessCode", oAuth);
    // throw new RuntimeException("No OAuth2 authentication configured!");
  }
881438
def revoke_user_access(self, db_names, strict=True):
        
        return self.manager.revoke_user_access(self, db_names, strict=strict)
592220
function removeRolePrivilege (access, role, privilege) {
  if (role === true) {
    access[privilege] = {
      role: []
    }
    return
  }

  if (access[privilege].role === true) {
    access[privilege].role = true
  }

  _.pullAll(access[privilege].role, _.concat(role))
}
93974
def revoke_access_token(self, access_token):
        
        payload = {'access_token': access_token,}
        req = requests.post(settings.API_DEAUTHORIZATION_URL, data=payload)
236791
public StoredCredential setAccessToken(String accessToken) {
    lock.lock();
    try {
      this.accessToken = accessToken;
    } finally {
      lock.unlock();
    }
    return this;
  }
1269188
public static void purgeOAuthAccessTokens(RequestContext requestContext, String provider) {
    String key = String.format(PROVIDER_ACCESS_TOKENS, provider);
    HttpSession session = requestContext.getRequest().getSession();
    OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(key);
    if (accessTokens != null) {
      session.removeAttribute(key);
    }
  }