Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql.coremodel
Class SQLSecurityManager

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.coremodel.SQLSecurityManager
All Implemented Interfaces:
SecurityManager

public class SQLSecurityManager
extends Object
implements SecurityManager

Author:
Florent Guillaume

Constructor Summary
SQLSecurityManager()
           
 
Method Summary
 boolean checkPermission(Document doc, String username, String permission)
          Checks whether this ACP grant the given permission on the given user.
 Access getAccess(Document doc, String username, String permission)
          Checks whether this ACP grant the given permission on the given user, denies it or doesn't specify a rule.
 ACP getACP(Document doc)
           
 ACP getMergedACP(Document doc)
           
 void setACP(Document doc, ACP acp, boolean overwrite)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLSecurityManager

public SQLSecurityManager()
Method Detail

getACP

public ACP getACP(Document doc)
           throws SecurityException
Specified by:
getACP in interface SecurityManager
Throws:
SecurityException

setACP

public void setACP(Document doc,
                   ACP acp,
                   boolean overwrite)
            throws SecurityException
Specified by:
setACP in interface SecurityManager
Throws:
SecurityException

getMergedACP

public ACP getMergedACP(Document doc)
                 throws SecurityException
Specified by:
getMergedACP in interface SecurityManager
Throws:
SecurityException

checkPermission

public boolean checkPermission(Document doc,
                               String username,
                               String permission)
                        throws SecurityException
Description copied from interface: SecurityManager
Checks whether this ACP grant the given permission on the given user.

The merged ACP is checked (this means all parents ACP + the local one) but this doesn't check user groups or permission groups.

If the ACP is not explicitly denying or granting the permission false is returned (the default behavior is to deny).

Specified by:
checkPermission in interface SecurityManager
Parameters:
doc - the document
username - the user name
permission - the permission to check
Returns:
true if granted, false if denied
Throws:
SecurityException

getAccess

public Access getAccess(Document doc,
                        String username,
                        String permission)
                 throws SecurityException
Description copied from interface: SecurityManager
Checks whether this ACP grant the given permission on the given user, denies it or doesn't specify a rule.

Specified by:
getAccess in interface SecurityManager
Parameters:
doc - the document
username - the user name
permission - the permission to check
Returns:
Access.GRANT if granted, Access.DENY if denied or Access.UNKNOWN if no rule for that permission exists. Never return null
Throws:
SecurityException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.