Пример #1
0
  public void delete(final Subject subject) {
    ResourceRequestBuilderFactory.<Acl>newBuilder()
        .forResource(
            "/authz"
                + resource
                + "?subject="
                + subject.getPrincipal()
                + "&type="
                + subject.getType()
                + "&perm="
                + action.getName())
        .delete() //
        .withCallback(
            new ResourceCallback<Acl>() {

              @Override
              public void onResource(Response response, Acl resource) {
                if (response.getStatusCode() == Response.SC_OK) {
                  aclDeleteCallback.onDelete(subject);
                } else {
                  aclDeleteCallback.onDeleteFailed(response, subject);
                }
              }
            })
        .send();
  }
Пример #2
0
 private boolean hasAction(Acl acl) {
   for (int i = 0; i < acl.getActionsArray().length(); i++) {
     if (acl.getActionsArray().get(i).equals(action.getName())) {
       return true;
     }
   }
   return false;
 }
Пример #3
0
 public String getHeader() {
   return action.getName();
 }