Package org.apache.sling.cms
Interface AuthorizableWrapper
@ProviderType
public interface AuthorizableWrapper
A wrapper for working with JackRabbit Authorizables in JSPs and Sling Models
from a Resource
-
Method Summary
Modifier and TypeMethodDescription@NotNull org.apache.jackrabbit.api.security.user.AuthorizableGets the JackRabbit Authorizable@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>Gets the declared members of this authorizable.@NotNull Iterator<org.apache.jackrabbit.api.security.user.Group>Get the groups this authorizable is a member ofGets a collection of all of the groups this user belongs to including containing groups.@Nullable StringgetId()Get the id of the current user.@Nullable LocaleGets the locale configured for the authorizable@Nullable StringGets the locale tag configured for the authorizable@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>Gets the transitive members of this authorizable.@NotNull Iterator<org.apache.jackrabbit.api.security.user.Group>Gets the transitive membership of this authorizablebooleanReturns true if the authorizable is a user and is the admin user or is a member of the administrators group.booleanReturns true if the authorizable is a member of the group
-
Method Details
-
getAuthorizable
@NotNull @NotNull org.apache.jackrabbit.api.security.user.Authorizable getAuthorizable()Gets the JackRabbit Authorizable- Returns:
- a JackRabbit Authorizable
-
getDeclaredMembers
@NotNull @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> getDeclaredMembers()Gets the declared members of this authorizable. For Users this will return an empty iterator.- Returns:
- the declared members of this authorizable
-
getDeclaredMembership
Get the groups this authorizable is a member of- Returns:
- the direct membership
-
getGroupNames
Gets a collection of all of the groups this user belongs to including containing groups.- Returns:
- the groups the user belongs to
-
getId
Get the id of the current user.- Returns:
- the current user's ID
-
getLocaleTag
Gets the locale tag configured for the authorizable- Returns:
- the locale tag
-
getLocale
Gets the locale configured for the authorizable- Returns:
- the locale
-
getMembers
Gets the transitive members of this authorizable. For Users this will return an empty iterator.- Returns:
- the transitive members of this authorizable
-
getMembership
Gets the transitive membership of this authorizable- Returns:
- the transitive membership
-
isAdministrator
boolean isAdministrator()Returns true if the authorizable is a user and is the admin user or is a member of the administrators group.- Returns:
- true if the user is a super user
-
isMember
Returns true if the authorizable is a member of the group- Parameters:
groupName- the name of the group to check- Returns:
- true if the authorizable is a member of the group
-