Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webapp.security
Class SecurityActionsBean

java.lang.Object
  extended by org.nuxeo.ecm.webapp.base.InputController
      extended by org.nuxeo.ecm.webapp.security.SecurityActionsBean
All Implemented Interfaces:
Serializable, SecurityActions

@Name(value="securityActions")
@Scope(value=CONVERSATION)
public class SecurityActionsBean
extends InputController
implements SecurityActions, Serializable

Provides security related methods.

Author:
Razvan Caraghin
See Also:
Serialized Form

Constructor Summary
SecurityActionsBean()
           
 
Method Summary
 String addPermission()
          Adds a permission to the list of permissions for the current document.
 String addPermission(String principalName, String permissionName, boolean grant)
           
 String addPermissionAndUpdate()
          Adds a permission to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 String addPermissions()
          Adds a list of permission to the list of permissions for the current document.
 String addPermissionsAndUpdate()
          Adds a list of permissions to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 Boolean displayInheritedPermissions()
           
 Boolean getBlockRightInheritance()
           
 boolean getCanAddSecurityRules()
          Returns true if the implementator if the principal has the permission to add new security rules on currentItem.
 boolean getCanRemoveSecurityRules()
          Returns true if the implementator can provide a list of permissions delete now and the principal has WriteSecurity permission on the currentItem.
 List<String> getCurrentDocumentUsers()
           
 UserPermissionsTableModel getDataTableModel()
           
 boolean getDisplayInheritedPermissions()
          Returns true if inherited permissions have to be displayed (depending on rights blocking)
 Map<String,String> getIconAltMap()
          Maps the principal type to the icon alt text.
 Map<String,String> getIconPathMap()
          Maps the principal type to the icon path.
 List<String> getParentDocumentsUsers()
           
 SecurityData getSecurityData()
           
 List<String> getSelectedEntries()
          Returns selected entries used in add/remove methods
 String getSelectedEntry()
          Returns selected entry used in add/remove methods
 List<SelectItem> getSettablePermissions()
           
 List<UserVisiblePermission> getVisibleUserPermissions(String documentType)
           
 void rebuildSecurityData()
          Rebuilds the security displayable data from the current selected document.
 String removePermission()
          Removes a permission from the list of permissions for the current document.
 String removePermissionAndUpdate()
          Removes a permission from the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 String removePermissions()
           
 String removePermissionsAndUpdate()
           
 void resetSecurityData()
          Marks the current security data info as obsolete so that it gets lazily recomputed from the backend the next time it is accessed.
 String saveSecurityUpdates()
           
 void setBlockRightInheritance(Boolean blockRightInheritance)
           
 void setSelectedEntries(List<String> selectedEntries)
          Sets selected entries used in add/remove methods
 void setSelectedEntry(String selectedEntry)
          Sets selected entry used in add/remove methods
 String updateSecurityOnDocument()
          Submits the security changes to the backend.
 
Methods inherited from class org.nuxeo.ecm.webapp.base.InputController
computeOutcome, getAdministrator, logDocumentWithName, logDocumentWithTitle, removeDocumentFromList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityActionsBean

public SecurityActionsBean()
Method Detail

resetSecurityData

@Observer(value="userAllDocumentTypesSelectionChanged",
          create=false)
@BypassInterceptors
public void resetSecurityData()
Description copied from interface: SecurityActions
Marks the current security data info as obsolete so that it gets lazily recomputed from the backend the next time it is accessed.

Specified by:
resetSecurityData in interface SecurityActions

rebuildSecurityData

public void rebuildSecurityData()
                         throws ClientException
Description copied from interface: SecurityActions
Rebuilds the security displayable data from the current selected document.

Specified by:
rebuildSecurityData in interface SecurityActions
Throws:
ClientException

getDataTableModel

public UserPermissionsTableModel getDataTableModel()
                                            throws ClientException
Specified by:
getDataTableModel in interface SecurityActions
Returns:
a UserPermissionsTableModel used to build a checkboxable listing of managed permissions
Throws:
ClientException

getSecurityData

public SecurityData getSecurityData()
                             throws ClientException
Specified by:
getSecurityData in interface SecurityActions
Returns:
the SecurityData object that manages a stateful representation of the permissions mapping that apply to the current document (inherited or not)
Throws:
ClientException

updateSecurityOnDocument

public String updateSecurityOnDocument()
                                throws ClientException
Description copied from interface: SecurityActions
Submits the security changes to the backend.

Specified by:
updateSecurityOnDocument in interface SecurityActions
Returns:
the page that will be displayed next
Throws:
ClientException

addPermission

public String addPermission(String principalName,
                            String permissionName,
                            boolean grant)
                     throws ClientException
Specified by:
addPermission in interface SecurityActions
Throws:
ClientException

addPermission

public String addPermission()
                     throws ClientException
Description copied from interface: SecurityActions
Adds a permission to the list of permissions for the current document. After all client side changes are made, then the list of permissions need to be submitted on backend using updateSecurityOnDocument()>.

Specified by:
addPermission in interface SecurityActions
Returns:
the page that needs to be displayed next
Throws:
ClientException

addPermissions

public String addPermissions()
                      throws ClientException
Description copied from interface: SecurityActions
Adds a list of permission to the list of permissions for the current document. After all client side changes are made, then the list of permissions need to be submitted on backend using updateSecurityOnDocument()>.

Specified by:
addPermissions in interface SecurityActions
Returns:
the page that needs to be displayed next
Throws:
ClientException

addPermissionAndUpdate

public String addPermissionAndUpdate()
                              throws ClientException
Description copied from interface: SecurityActions
Adds a permission to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.

Specified by:
addPermissionAndUpdate in interface SecurityActions
Returns:
the page that needs to be displayed next
Throws:
ClientException

addPermissionsAndUpdate

public String addPermissionsAndUpdate()
                               throws ClientException
Description copied from interface: SecurityActions
Adds a list of permissions to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.

Specified by:
addPermissionsAndUpdate in interface SecurityActions
Returns:
the page that needs to be displayed next
Throws:
ClientException

saveSecurityUpdates

public String saveSecurityUpdates()
                           throws ClientException
Specified by:
saveSecurityUpdates in interface SecurityActions
Throws:
ClientException

removePermission

public String removePermission()
Description copied from interface: SecurityActions
Removes a permission from the list of permissions for the current document. After all client side changes are made, then the list of permissions need to be submitted on backend using updateSecurityOnDocument()>.

Specified by:
removePermission in interface SecurityActions
Returns:
the page that needs to be displayed next

removePermissionAndUpdate

public String removePermissionAndUpdate()
                                 throws ClientException
Description copied from interface: SecurityActions
Removes a permission from the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.

Specified by:
removePermissionAndUpdate in interface SecurityActions
Returns:
the page that needs to be displayed next
Throws:
ClientException

removePermissions

public String removePermissions()
                         throws ClientException
Specified by:
removePermissions in interface SecurityActions
Throws:
ClientException

removePermissionsAndUpdate

public String removePermissionsAndUpdate()
                                  throws ClientException
Specified by:
removePermissionsAndUpdate in interface SecurityActions
Throws:
ClientException

getCanAddSecurityRules

public boolean getCanAddSecurityRules()
                               throws ClientException
Description copied from interface: SecurityActions
Returns true if the implementator if the principal has the permission to add new security rules on currentItem.

Specified by:
getCanAddSecurityRules in interface SecurityActions
Throws:
ClientException

getCanRemoveSecurityRules

public boolean getCanRemoveSecurityRules()
                                  throws ClientException
Description copied from interface: SecurityActions
Returns true if the implementator can provide a list of permissions delete now and the principal has WriteSecurity permission on the currentItem.

Specified by:
getCanRemoveSecurityRules in interface SecurityActions
Throws:
ClientException

getVisibleUserPermissions

public List<UserVisiblePermission> getVisibleUserPermissions(String documentType)
                                                      throws ClientException
Throws:
ClientException

getSettablePermissions

public List<SelectItem> getSettablePermissions()
                                        throws ClientException
Specified by:
getSettablePermissions in interface SecurityActions
Returns:
the list of permissions the users can set through the rights management tab
Throws:
ClientException

getIconAltMap

public Map<String,String> getIconAltMap()
Description copied from interface: SecurityActions
Maps the principal type to the icon alt text.

Specified by:
getIconAltMap in interface SecurityActions

getIconPathMap

public Map<String,String> getIconPathMap()
Description copied from interface: SecurityActions
Maps the principal type to the icon path.

Specified by:
getIconPathMap in interface SecurityActions

getBlockRightInheritance

public Boolean getBlockRightInheritance()
Specified by:
getBlockRightInheritance in interface SecurityActions

setBlockRightInheritance

public void setBlockRightInheritance(Boolean blockRightInheritance)
                              throws ClientException
Specified by:
setBlockRightInheritance in interface SecurityActions
Throws:
ClientException

displayInheritedPermissions

public Boolean displayInheritedPermissions()
                                    throws ClientException
Specified by:
displayInheritedPermissions in interface SecurityActions
Throws:
ClientException

getDisplayInheritedPermissions

public boolean getDisplayInheritedPermissions()
                                       throws ClientException
Description copied from interface: SecurityActions
Returns true if inherited permissions have to be displayed (depending on rights blocking)

Specified by:
getDisplayInheritedPermissions in interface SecurityActions
Throws:
ClientException

getCurrentDocumentUsers

public List<String> getCurrentDocumentUsers()
                                     throws ClientException
Specified by:
getCurrentDocumentUsers in interface SecurityActions
Throws:
ClientException

getParentDocumentsUsers

public List<String> getParentDocumentsUsers()
                                     throws ClientException
Specified by:
getParentDocumentsUsers in interface SecurityActions
Throws:
ClientException

getSelectedEntry

public String getSelectedEntry()
Description copied from interface: SecurityActions
Returns selected entry used in add/remove methods

Specified by:
getSelectedEntry in interface SecurityActions

setSelectedEntry

public void setSelectedEntry(String selectedEntry)
Description copied from interface: SecurityActions
Sets selected entry used in add/remove methods

Specified by:
setSelectedEntry in interface SecurityActions

getSelectedEntries

public List<String> getSelectedEntries()
Description copied from interface: SecurityActions
Returns selected entries used in add/remove methods

Specified by:
getSelectedEntries in interface SecurityActions

setSelectedEntries

public void setSelectedEntries(List<String> selectedEntries)
Description copied from interface: SecurityActions
Sets selected entries used in add/remove methods

Specified by:
setSelectedEntries in interface SecurityActions

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.