Class AuthorizableResource
java.lang.Object
org.apache.sling.api.adapter.SlingAdaptable
org.apache.sling.api.resource.AbstractResource
org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResource
- Direct Known Subclasses:
NestedAuthorizableResource
@Adaptable(adaptableClass=Resource.class,adapters={@Adapter({java.util.Map.class,ValueMap.class,org.apache.jackrabbit.api.security.user.Authorizable.class}),@Adapter(condition="If the resource is an AuthorizableResource and represents a JCR User",value=org.apache.jackrabbit.api.security.user.User.class),@Adapter(condition="If the resource is an AuthorizableResource and represents a JCR Group",value=org.apache.jackrabbit.api.security.user.Group.class)})
public class AuthorizableResource
extends BaseResource
Resource implementation for Authorizable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.jackrabbit.api.security.user.Authorizableprotected final SystemUserManagerPathsFields inherited from class org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
resourceResolverFields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING -
Constructor Summary
ConstructorsConstructorDescriptionAuthorizableResource(org.apache.jackrabbit.api.security.user.Authorizable authorizable, ResourceResolver resourceResolver, String path, SystemUserManagerPaths systemUserManagerPaths) -
Method Summary
Modifier and TypeMethodDescription<T> TCalls into the registeredAdapterManagerto adapt this object to the desiredtype.The resource type is meant to point to rendering/processing scripts, editing dialogs, etc.protected StringtoResourceType(org.apache.jackrabbit.api.security.user.Authorizable authorizable) determine the resource type for the authorizable.toString()Methods inherited from class org.apache.sling.jackrabbit.usermanager.impl.resource.BaseResource
getPath, getResourceMetadata, getResourceResolver, getResourceSuperTypeMethods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildrenMethods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
-
Field Details
-
authorizable
protected final org.apache.jackrabbit.api.security.user.Authorizable authorizable -
systemUserManagerPaths
-
-
Constructor Details
-
AuthorizableResource
public AuthorizableResource(org.apache.jackrabbit.api.security.user.Authorizable authorizable, ResourceResolver resourceResolver, String path, SystemUserManagerPaths systemUserManagerPaths)
-
-
Method Details
-
toResourceType
determine the resource type for the authorizable.- Parameters:
authorizable- the authorizable to consider- Returns:
- the resource type
-
getResourceType
Description copied from interface:ResourceThe resource type is meant to point to rendering/processing scripts, editing dialogs, etc. It is usually a path in the repository, where scripts and other tools definitions are found, but theResourceResolveris free to set this to any suitable value such as the primary node type of the JCR node from which the resource is created.If the resource instance represents a resource which is not actually existing, this method returns
Resource.RESOURCE_TYPE_NON_EXISTING.- Returns:
- The resource type
-
adaptTo
Description copied from class:SlingAdaptableCalls into the registeredAdapterManagerto adapt this object to the desiredtype.This method implements a cache of adapters to improve performance. That is repeated calls to this method with the same class will result in the same object to be returned.
- Specified by:
adaptToin interfaceAdaptable- Overrides:
adaptToin classSlingAdaptable- Type Parameters:
T- The generic type to which this resource is adapted to- Parameters:
type- The Class object of the target type, such asjavax.jcr.Node.classorjava.io.File.class- Returns:
- The adapter target or
nullif the resource cannot adapt to the requested type
-
toString
-