Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.query.test
Class NoFileSecurityPolicy

java.lang.Object
  extended by org.nuxeo.ecm.core.query.test.NoFileSecurityPolicy
All Implemented Interfaces:
SecurityPolicy
Direct Known Subclasses:
NoFile2SecurityPolicy

public class NoFileSecurityPolicy
extends java.lang.Object
implements SecurityPolicy

Dummy security policy denying all access to File objects.

Author:
Florent Guillaume

Constructor Summary
NoFileSecurityPolicy()
           
 
Method Summary
 Access checkPermission(Document doc, ACP mergedAcp, java.security.Principal principal, java.lang.String permission, java.lang.String[] resolvedPermissions, java.lang.String[] additionalPrincipals)
          Checks given permission for doc and principal.
 SQLQuery.Transformer getQueryTransformer()
          Get the transformer to use to apply this policy to a query.
 boolean isExpressibleInQuery()
          Checks if this policy can be expressed in a query.
 boolean isRestrictingPermission(java.lang.String permission)
          Checks if this policy is restricting the given permission.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoFileSecurityPolicy

public NoFileSecurityPolicy()
Method Detail

checkPermission

public Access checkPermission(Document doc,
                              ACP mergedAcp,
                              java.security.Principal principal,
                              java.lang.String permission,
                              java.lang.String[] resolvedPermissions,
                              java.lang.String[] additionalPrincipals)
Description copied from interface: SecurityPolicy
Checks given permission for doc and principal.

Note that for the Browse permission, which is also implemented in SQL using SecurityPolicy.getQueryTransformer(), a security policy must never bypass standard ACL access, it must only return DENY or UNKNOWN. Failing to do this would make direct access and queries behave differently.

Specified by:
checkPermission in interface SecurityPolicy
Parameters:
doc - the document to check
mergedAcp - merged ACP resolved for this document
principal - principal to check
permission - permission to check
resolvedPermissions - permissions or groups of permissions containing permission
Returns:
access: GRANT, DENY, or UNKNOWN. When UNKNOWN is returned, following policies or default core security are applied.

isRestrictingPermission

public boolean isRestrictingPermission(java.lang.String permission)
Description copied from interface: SecurityPolicy
Checks if this policy is restricting the given permission.

Queries check the BROWSE permission.

Specified by:
isRestrictingPermission in interface SecurityPolicy
Parameters:
permission - the permission to check for
Returns:
true if the policy restricts the permission

isExpressibleInQuery

public boolean isExpressibleInQuery()
Description copied from interface: SecurityPolicy
Checks if this policy can be expressed in a query.

If not, then any query made will have to be post-filtered.

Specified by:
isExpressibleInQuery in interface SecurityPolicy
Returns:
true if the policy can be expressed in a query

getQueryTransformer

public SQLQuery.Transformer getQueryTransformer()
Description copied from interface: SecurityPolicy
Get the transformer to use to apply this policy to a query.

Called only when SecurityPolicy.isExpressibleInQuery() returned true

Specified by:
getQueryTransformer in interface SecurityPolicy
Returns:
the transformer

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.