/** * The originally requested resource for this Authorizable. Because policies are inherited, if a resource * does not have a policy, this Authorizable may represent a parent resource and this method will return * the originally requested resource. * * @return the originally requested resource */ default Resource getRequestedResource() { return getResource(); }
@Override public Resource getResource() { final Resource parentResource = parent.getResource(); return new Resource() { @Override public String getIdentifier() { return parentResource.getIdentifier(); } @Override public String getName() { return parentResource.getName(); } @Override public String getSafeDescription() { return resource.getSafeDescription(); } }; } };
@Override public Resource getResource() { final Resource parentResource = parent.getResource(); return new Resource() { @Override public String getIdentifier() { return parentResource.getIdentifier(); } @Override public String getName() { return parentResource.getName(); } @Override public String getSafeDescription() { return resource.getSafeDescription(); } }; } };
@Override public Resource getResource() { return ResourceFactory.getDataTransferResource(authorizable.getResource()); } }
@Override public Resource getResource() { return ResourceFactory.getOperationResource(baseAuthorizable.getResource()); }
@Override public Resource getResource() { return ResourceFactory.getDataResource(authorizable.getResource()); }
@Override public Resource getResource() { return ResourceFactory.getProvenanceDataResource(authorizable.getResource()); }
@Override public Resource getResource() { return ResourceFactory.getPolicyResource(getEffectiveAuthorizable().getResource()); }
@Override public AccessPolicy getAccessPolicy(final RequestAction requestAction, final Authorizable authorizable) { final String resource = authorizable.getResource().getIdentifier(); final AccessPolicy accessPolicy = findAccessPolicy(requestAction, authorizable.getResource().getIdentifier()); if (accessPolicy == null) { final Authorizable parentAuthorizable = authorizable.getParentAuthorizable(); if (parentAuthorizable == null) { throw new ResourceNotFoundException(String.format("Unable to find access policy for %s on %s", requestAction.toString(), resource)); } else { return getAccessPolicy(requestAction, parentAuthorizable); } } return accessPolicy; }
public ComponentReferenceDTO createComponentReferenceDto(final Authorizable authorizable) { if (authorizable == null || !(authorizable instanceof ComponentAuthorizable)) { return null; } final ComponentAuthorizable componentAuthorizable = (ComponentAuthorizable) authorizable; final ComponentReferenceDTO dto = new ComponentReferenceDTO(); dto.setId(componentAuthorizable.getIdentifier()); dto.setParentGroupId(componentAuthorizable.getProcessGroupIdentifier()); dto.setName(authorizable.getResource().getName()); return dto; }
final Resource resource = getResource(); final Resource requestedResource = getRequestedResource(); final AuthorizationRequest request = new AuthorizationRequest.Builder()
final Resource resource = getResource(); final Resource requestedResource = getRequestedResource(); final AuthorizationRequest request = new AuthorizationRequest.Builder()