Exemplo n.º 1
0
 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);
   }
 }
Exemplo n.º 2
0
 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");
   }
 }