ModeShape Distribution 3.5.0.Final

org.modeshape.jcr.security
Interface AdvancedAuthorizationProvider


public interface AdvancedAuthorizationProvider

An interface that can authorize access to specific resources within repositories. Unlike the more basic and simpl AuthenticationProvider, this interface allows an implementation to get at additional information with each call to hasPermission(Context, Path, String...).

In particular, the supplied AdvancedAuthorizationProvider.Context instance contains the Session that is calling this provider, allowing the provider implementation to access authorization-specific content within the repository to determine permissions for other repository content.

In these cases, calls to the session to access nodes will result in their own calls to hasPermission(Context, Path, String...). Therefore, such implementations need to handle these special authorization-specific content permissions in an explicit fashion. It is also adviced that such providers cache as much of the authorization-specifc content as possible, as the hasPermission(Context, Path, String...) method is called frequently.


Nested Class Summary
static interface AdvancedAuthorizationProvider.Context
          The context in which the calling session is operating, and which contains session-related information that a provider implementation may find useful.
 
Method Summary
 boolean hasPermission(AdvancedAuthorizationProvider.Context context, Path absPath, String... actions)
          Determine if the supplied execution context has permission for all of the named actions in the given context.
 

Method Detail

hasPermission

boolean hasPermission(AdvancedAuthorizationProvider.Context context,
                      Path absPath,
                      String... actions)
Determine if the supplied execution context has permission for all of the named actions in the given context. If not all actions are allowed, the method returns false.

Parameters:
context - the context in which the subject is performing the actions on the supplied workspace
absPath - the absolute path on which the actions are occurring, or null if the permissions are at the workspace-level
actions - the list of actions to check
Returns:
true if the subject has privilege to perform all of the named actions on the content at the supplied path in the given workspace within the repository, or false otherwise

ModeShape Distribution 3.5.0.Final

Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.