org.apache.jackrabbit.api.security.user
Interface Impersonation


public interface Impersonation

The Impersonation maintains Principals that are allowed to impersonate. Principals can be added or removed using grantImpersonation(Principal) and revokeImpersonation(Principal), respectively.

See Also:
User.getImpersonation()

Method Summary
 boolean allows(Subject subject)
          Test if the given subject (i.e.
 PrincipalIterator getImpersonators()
           
 boolean grantImpersonation(Principal principal)
           
 boolean revokeImpersonation(Principal principal)
           
 

Method Detail

getImpersonators

PrincipalIterator getImpersonators()
                                   throws javax.jcr.RepositoryException
Returns:
An iterator over the Principals that are allowed to impersonate the User this Impersonation object has been created for.
Throws:
javax.jcr.RepositoryException

grantImpersonation

boolean grantImpersonation(Principal principal)
                           throws javax.jcr.RepositoryException
Parameters:
principal - The principal that should be allowed to impersonate the User this Impersonation 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:
javax.jcr.RepositoryException

revokeImpersonation

boolean revokeImpersonation(Principal principal)
                            throws javax.jcr.RepositoryException
Parameters:
principal -
Returns:
If the granted impersonation has been successfully revoked for the given principal; false otherwise.
Throws:
javax.jcr.RepositoryException

allows

boolean allows(Subject subject)
               throws javax.jcr.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:
javax.jcr.RepositoryException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.