Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webapp.security
Class SecurityData

java.lang.Object
  extended by org.nuxeo.ecm.webapp.security.SecurityData
All Implemented Interfaces:
Serializable

public class SecurityData
extends Object
implements Serializable

Holds the formatted security data, ready to be displayed. Holds the data on each map on the following structure:

current doc grants:
user 1 - perm1, perm2
user 2 - perm1, perm2
user 3 - perm2
current doc denies:
...
parent doc grants:
...
parent doc denies:
...

Also has methods that allow manipulation of the contained data, such as add/remove security privileges. The end result after add/remove has been called will be converted to a backend security DTO and then submitted on backend.

Author:
Razvan Caraghin
See Also:
Serialized Form

Constructor Summary
SecurityData()
           
 
Method Summary
 void addModifiablePrivilege(String principalName, String permissionName, boolean grant)
          Adds a privilege to the displayed list.
 void addUnModifiablePrivilege(String principalName, String permissionName, boolean grant)
          Adds an unmodifiable privilege to the displayed list (these are related to the parent documents).
 void clear()
           
 Map<String,List<String>> getCurrentDocDeny()
           
 Map<String,List<String>> getCurrentDocGrant()
           
 List<String> getCurrentDocumentUsers()
           
 String getDocumentType()
           
 boolean getNeedSave()
           
 Map<String,List<String>> getParentDocsDeny()
           
 Map<String,List<String>> getParentDocsDenyLabels()
           
 Map<String,List<String>> getParentDocsGrant()
           
 Map<String,List<String>> getParentDocsGrantLabels()
           
 List<String> getParentDocumentsUsers()
           
 void rebuildUserLists()
           
 void removeModifiablePrivilege(String principalName)
          Removes all privileges for a given user.
 boolean removeModifiablePrivilege(String principalName, String permissionName, boolean grant)
          Removes a privilege from the displayed list.
 void setCurrentDocDeny(Map<String,List<String>> deny)
           
 void setCurrentDocGrant(Map<String,List<String>> grant)
           
 void setDocumentType(String documentType)
           
 void setNeedSave(boolean needSave)
           
 void setParentDocsDeny(Map<String,List<String>> parentDocsDeny)
           
 void setParentDocsGrant(Map<String,List<String>> parentDocsGrant)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityData

public SecurityData()
Method Detail

setNeedSave

public void setNeedSave(boolean needSave)

getNeedSave

public boolean getNeedSave()

getCurrentDocDeny

public Map<String,List<String>> getCurrentDocDeny()

setCurrentDocDeny

public void setCurrentDocDeny(Map<String,List<String>> deny)

getCurrentDocGrant

public Map<String,List<String>> getCurrentDocGrant()

setCurrentDocGrant

public void setCurrentDocGrant(Map<String,List<String>> grant)

getParentDocsDenyLabels

public Map<String,List<String>> getParentDocsDenyLabels()

getParentDocsDeny

public Map<String,List<String>> getParentDocsDeny()

setParentDocsDeny

public void setParentDocsDeny(Map<String,List<String>> parentDocsDeny)

getParentDocsGrant

public Map<String,List<String>> getParentDocsGrant()

getParentDocsGrantLabels

public Map<String,List<String>> getParentDocsGrantLabels()

setParentDocsGrant

public void setParentDocsGrant(Map<String,List<String>> parentDocsGrant)

getCurrentDocumentUsers

public List<String> getCurrentDocumentUsers()

getParentDocumentsUsers

public List<String> getParentDocumentsUsers()

rebuildUserLists

public void rebuildUserLists()

addModifiablePrivilege

public void addModifiablePrivilege(String principalName,
                                   String permissionName,
                                   boolean grant)
Adds a privilege to the displayed list. This does not submit anything to the backend.


removeModifiablePrivilege

public boolean removeModifiablePrivilege(String principalName,
                                         String permissionName,
                                         boolean grant)
Removes a privilege from the displayed list. This does not submit anything to backend.

Returns:
true if a privilege was indeed removed

removeModifiablePrivilege

public void removeModifiablePrivilege(String principalName)
Removes all privileges for a given user. This does not edit the backend.


addUnModifiablePrivilege

public void addUnModifiablePrivilege(String principalName,
                                     String permissionName,
                                     boolean grant)
Adds an unmodifiable privilege to the displayed list (these are related to the parent documents).


clear

public void clear()

getDocumentType

public String getDocumentType()

setDocumentType

public void setDocumentType(String documentType)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.