Interface Impersonation
-
@ProviderType public interface Impersonation
TheImpersonation
maintains Principals that are allowed to impersonate. Principals can be added or removed usinggrantImpersonation(Principal)
andrevokeImpersonation(Principal)
, respectively.- See Also:
User.getImpersonation()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
allows(@NotNull Subject subject)
Test if the given subject (i.e.@NotNull PrincipalIterator
getImpersonators()
boolean
grantImpersonation(@NotNull Principal principal)
boolean
revokeImpersonation(@NotNull Principal principal)
-
-
-
Method Detail
-
getImpersonators
@NotNull @NotNull PrincipalIterator getImpersonators() throws RepositoryException
- Returns:
- An iterator over the
Principal
s that are allowed to impersonate theUser
thisImpersonation
object has been created for. - Throws:
RepositoryException
- If an error occurs.
-
grantImpersonation
boolean grantImpersonation(@NotNull @NotNull Principal principal) throws RepositoryException
- Parameters:
principal
- The principal that should be allowed to impersonate theUser
thisImpersonation
has been built for.- Returns:
- true if the specified
Principal
has not been allowed to impersonate before and if impersonation has been successfully granted to it, false otherwise. - Throws:
RepositoryException
- If an error occurs.
-
revokeImpersonation
boolean revokeImpersonation(@NotNull @NotNull Principal principal) throws RepositoryException
- Parameters:
principal
- The principal that should no longer be allowed to impersonate.- Returns:
- If the granted impersonation has been successfully revoked for the given principal; false otherwise.
- Throws:
RepositoryException
- If an error occurs.
-
allows
boolean allows(@NotNull @NotNull Subject subject) throws RepositoryException
Test if the given subject (i.e. any of the principals it contains) is allowed to impersonate.- Parameters:
subject
- to impersonate.- Returns:
- true if this
Impersonation
allows the specified Subject to impersonate. - Throws:
RepositoryException
- If an error occurs.
-
-