Package org.apache.sling.cms
Interface AuthorizableWrapper
-
@ProviderType public interface AuthorizableWrapperA wrapper for working with JackRabbit Authorizables in JSPs and Sling Models from a Resource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull org.apache.jackrabbit.api.security.user.AuthorizablegetAuthorizable()Gets the JackRabbit Authorizable@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>getDeclaredMembers()Gets the declared members of this authorizable.@NotNull Iterator<org.apache.jackrabbit.api.security.user.Group>getDeclaredMembership()Get the groups this authorizable is a member of@NotNull Iterator<String>getGroupNames()Gets a collection of all of the groups this user belongs to including containing groups.@Nullable StringgetId()Get the id of the current user.@Nullable LocalegetLocale()Gets the locale configured for the authorizable@Nullable StringgetLocaleTag()Gets the locale tag configured for the authorizable@NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable>getMembers()Gets the transitive members of this authorizable.@NotNull Iterator<org.apache.jackrabbit.api.security.user.Group>getMembership()Gets the transitive membership of this authorizablebooleanisAdministrator()Returns true if the authorizable is a user and is the admin user or is a member of the administrators group.booleanisMember(String groupName)Returns true if the authorizable is a member of the group
-
-
-
Method Detail
-
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
@NotNull @NotNull Iterator<org.apache.jackrabbit.api.security.user.Group> getDeclaredMembership()
Get the groups this authorizable is a member of- Returns:
- the direct membership
-
getGroupNames
@NotNull @NotNull Iterator<String> getGroupNames()
Gets a collection of all of the groups this user belongs to including containing groups.- Returns:
- the groups the user belongs to
-
getId
@Nullable @Nullable String getId()
Get the id of the current user.- Returns:
- the current user's ID
-
getLocaleTag
@Nullable @Nullable String getLocaleTag()
Gets the locale tag configured for the authorizable- Returns:
- the locale tag
-
getLocale
@Nullable @Nullable Locale getLocale()
Gets the locale configured for the authorizable- Returns:
- the locale
-
getMembers
@NotNull @NotNull Iterator<org.apache.jackrabbit.api.security.user.Authorizable> getMembers()
Gets the transitive members of this authorizable. For Users this will return an empty iterator.- Returns:
- the transitive members of this authorizable
-
getMembership
@NotNull @NotNull Iterator<org.apache.jackrabbit.api.security.user.Group> 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
boolean isMember(String groupName)
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
-
-