Class AuthorizableResourceProvider
java.lang.Object
org.apache.sling.spi.resource.provider.ResourceProvider<Object>
org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider
- All Implemented Interfaces:
SystemUserManagerPaths
public class AuthorizableResourceProvider
extends ResourceProvider<Object>
implements SystemUserManagerPaths
Resource Provider implementation for jackrabbit UserManager resources.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
Interface for lambda expressions to do work on a resolved authorizable + optional relative pathstatic @interface
protected static interface
Interface for lambda expressions to do work on a resolved principal -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
Deprecated.no longer used.static final String
Deprecated.no longer used.static final String
Deprecated.no longer used.static final String
Deprecated.no longer used.static final String
Deprecated.no longer used.Fields inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
AUTH_ADMIN, AUTH_CLONE, AUTH_SERVICE_BUNDLE, AUTHENTICATE_LAZY, AUTHENTICATE_NO, AUTHENTICATE_REQUIRED, MODE_OVERLAY, MODE_PASSTHROUGH, PROPERTY_ADAPTABLE, PROPERTY_ATTRIBUTABLE, PROPERTY_AUTHENTICATE, PROPERTY_MODE, PROPERTY_MODIFIABLE, PROPERTY_NAME, PROPERTY_REFRESHABLE, PROPERTY_ROOT, PROPERTY_USE_RESOURCE_ACCESS_SECURITY, RESOURCE_TYPE_SYNTHETIC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
filterPropertyContainers
(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable, Resource r) Filter the resource children to return only the resources that are nested property containersThe path prefix (before the id) for groupsThe root path for all group resourcesgetPropertyNames
(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable) getResource
(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) Returns a resource from this resource provider ornull
if the resource provider cannot find it.The root path for usermanager resourcesThe path prefix (before the id) for usersThe root path for all user resourceslistChildren
(ResolveContext<Object> ctx, Resource parent) protected <T> T
maybeDoAuthorizableWork
(@NotNull ResolveContext<Object> ctx, @NotNull String path, @NotNull AuthorizableResourceProvider.AuthorizableWorker<T> authorizableWorker, @Nullable AuthorizableResourceProvider.PrincipalWorker<T> principalWorker) If the path resolves to a user or group (with optional relPath suffix) then invoke the worker to do some work.Methods inherited from class org.apache.sling.spi.resource.provider.ResourceProvider
adaptTo, authenticate, commit, copy, create, delete, getAttribute, getAttributeNames, getParent, getProviderContext, getQueryLanguageProvider, hasChanges, isLive, logout, move, orderBefore, refresh, revert, start, stop, update
-
Field Details
-
DEFAULT_SYSTEM_USER_MANAGER_PATH
- See Also:
-
SYSTEM_USER_MANAGER_PATH
Deprecated.no longer used. UseSystemUserManagerPaths
service instead.- See Also:
-
SYSTEM_USER_MANAGER_USER_PATH
Deprecated.no longer used. UseSystemUserManagerPaths
service instead.- See Also:
-
SYSTEM_USER_MANAGER_GROUP_PATH
Deprecated.no longer used. UseSystemUserManagerPaths
service instead.- See Also:
-
SYSTEM_USER_MANAGER_USER_PREFIX
Deprecated.no longer used. UseSystemUserManagerPaths
service instead.- See Also:
-
SYSTEM_USER_MANAGER_GROUP_PREFIX
Deprecated.no longer used. UseSystemUserManagerPaths
service instead.- See Also:
-
-
Constructor Details
-
AuthorizableResourceProvider
public AuthorizableResourceProvider()
-
-
Method Details
-
activate
-
getRootPath
Description copied from interface:SystemUserManagerPaths
The root path for usermanager resources- Specified by:
getRootPath
in interfaceSystemUserManagerPaths
-
getUsersPath
Description copied from interface:SystemUserManagerPaths
The root path for all user resources- Specified by:
getUsersPath
in interfaceSystemUserManagerPaths
-
getUserPrefix
Description copied from interface:SystemUserManagerPaths
The path prefix (before the id) for users- Specified by:
getUserPrefix
in interfaceSystemUserManagerPaths
-
getGroupsPath
Description copied from interface:SystemUserManagerPaths
The root path for all group resources- Specified by:
getGroupsPath
in interfaceSystemUserManagerPaths
-
getGroupPrefix
Description copied from interface:SystemUserManagerPaths
The path prefix (before the id) for groups- Specified by:
getGroupPrefix
in interfaceSystemUserManagerPaths
-
getResource
public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) Description copied from class:ResourceProvider
Returns a resource from this resource provider ornull
if the resource provider cannot find it. The path must have theResourceProvider.PROPERTY_ROOT
strings as its prefix. The resource provider must not return cached instances for a resource as the resource resolver will update the resource meta data of the resource at the end of the resolution process and this meta data might be different depending on the full path of resource resolution passed into the resource resolver.- Specified by:
getResource
in classResourceProvider<Object>
- Parameters:
ctx
- TheResolveContext
.path
- The full path of the resource.resourceContext
- Additional information for resolving the resourceparent
- Optional parent resource- Returns:
null
If this provider does not have a resource for the path.
-
maybeDoAuthorizableWork
protected <T> T maybeDoAuthorizableWork(@NotNull @NotNull ResolveContext<Object> ctx, @NotNull @NotNull String path, @NotNull @NotNull AuthorizableResourceProvider.AuthorizableWorker<T> authorizableWorker, @Nullable @Nullable AuthorizableResourceProvider.PrincipalWorker<T> principalWorker) If the path resolves to a user or group (with optional relPath suffix) then invoke the worker to do some work. -
getPropertyNames
-
listChildren
Description copied from class:ResourceProvider
Returns anIterator
ofResource
objects loaded from the children of the givenResource
. The returnedResource
instances are attached to the sameResourceResolver
as the givenparent
resource.This method may be called for resource providers whose root path list contains a path such that the resource path is a prefix of the list entry. This allows for the enumeration of deeply nested provided resources for which no actual parent hierarchy exists.
The returned iterator may in turn contain resources which do not actually exist but are required to traverse the resource tree. Such resources SHOULD be
SyntheticResource
objects whose resource type MUST be set toResourceProvider.RESOURCE_TYPE_SYNTHETIC
. As withResourceProvider.getResource(ResolveContext, String, ResourceContext, Resource)
the returned Resource objects must not be cached objects.- Specified by:
listChildren
in classResourceProvider<Object>
- Parameters:
ctx
- TheResolveContext
.parent
- TheResource
whose children are requested.- Returns:
- An
Iterator
ofResource
objects ornull
if the resource provider has no children for the given resource.
-
filterPropertyContainers
protected List<Resource> filterPropertyContainers(String relPath, org.apache.jackrabbit.api.security.user.Authorizable authorizable, Resource r) Filter the resource children to return only the resources that are nested property containers- Parameters:
relPath
- the relative path to start fromauthorizable
- the user or groupr
- the resource to filter the children of- Returns:
- list of resources that are property containers
-