public boolean canRevokeToken(String accessTokenId) { if (userIdentityContext.isGlobalUser()) { return entitlementEngine.canDelete( "/users/" + user.getId() + "/access-tokens/" + accessTokenId); } else { return entitlementEngine.canDeleteOnAccount( user.getAccountId(), "/users/" + user.getId() + "/access-tokens/" + accessTokenId); } }
public boolean canEditAccessTokenEntitlements(String accessTokenId) { if (userIdentityContext.isGlobalUser()) { return entitlementEngine.canPut( "/users/" + user.getId() + "/access-tokens/" + accessTokenId + "/entitlements"); } else { return entitlementEngine.canPutOnAccount( user.getAccountId(), "/users/" + user.getId() + "/access-tokens/" + accessTokenId + "/entitlements"); } }