Nuxeo Enterprise Platform 5.4

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:
java.io.Serializable, StatefulBaseLifeCycle, SecurityActions

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

Provides security related methods.

Author:
Razvan Caraghin
See Also:
Serialized Form

Constructor Summary
SecurityActionsBean()
           
 
Method Summary
 java.lang.String addPermission()
          Adds a permission to the list of permissions for the current document.
 java.lang.String addPermission(java.lang.String principalName, java.lang.String permissionName, boolean grant)
           
 java.lang.String addPermissionAndUpdate()
          Adds a permission to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 java.lang.String addPermissions()
          Adds a list of permission to the list of permissions for the current document.
 java.lang.String addPermissionsAndUpdate()
          Adds a list of permissions to the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 void destroy()
           
 java.lang.Boolean displayInheritedPermissions()
           
 java.lang.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.
 java.util.List<java.lang.String> getCurrentDocumentUsers()
           
 UserPermissionsTableModel getDataTableModel()
           
 boolean getDisplayInheritedPermissions()
          Returns true if inherited permissions have to be displayed (depending on rights blocking)
 java.util.Map<java.lang.String,java.lang.String> getIconAltMap()
          Maps the principal type to the icon alt text.
 java.util.Map<java.lang.String,java.lang.String> getIconPathMap()
          Maps the principal type to the icon path.
 java.util.List<java.lang.String> getParentDocumentsUsers()
           
 SecurityData getSecurityData()
           
 java.util.List<java.lang.String> getSelectedEntries()
          Returns selected entries used in add/remove methods
 java.lang.String getSelectedEntry()
          Returns selected entry used in add/remove methods
 java.util.List<javax.faces.model.SelectItem> getSettablePermissions()
           
 void readState()
          Activate method.
 void rebuildSecurityData()
          Rebuilds the security displayable data from the current selected document.
 java.lang.String removePermission()
          Removes a permission from the list of permissions for the current document.
 java.lang.String removePermissionAndUpdate()
          Removes a permission from the list of permissions for the current document and automatically update the backend with updateSecurityOnDocument()>.
 java.lang.String removePermissions()
           
 java.lang.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.
 java.lang.String saveSecurityUpdates()
           
 void saveState()
          Passivate method.
 void setBlockRightInheritance(java.lang.Boolean blockRightInheritance)
           
 void setSelectedEntries(java.util.List<java.lang.String> selectedEntries)
          Sets selected entries used in add/remove methods
 void setSelectedEntry(java.lang.String selectedEntry)
          Sets selected entry used in add/remove methods
 java.lang.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

destroy

@Destroy
public void destroy()
Specified by:
destroy in interface SecurityActions

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 java.lang.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 java.lang.String addPermission(java.lang.String principalName,
                                      java.lang.String permissionName,
                                      boolean grant)
Specified by:
addPermission in interface SecurityActions

addPermission

public java.lang.String addPermission()
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

addPermissions

public java.lang.String addPermissions()
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

addPermissionAndUpdate

public java.lang.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 java.lang.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 java.lang.String saveSecurityUpdates()
                                     throws ClientException
Specified by:
saveSecurityUpdates in interface SecurityActions
Throws:
ClientException

removePermission

public java.lang.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 java.lang.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 java.lang.String removePermissions()
                                   throws ClientException
Specified by:
removePermissions in interface SecurityActions
Throws:
ClientException

removePermissionsAndUpdate

public java.lang.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

getSettablePermissions

public java.util.List<javax.faces.model.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

saveState

public void saveState()
Description copied from interface: StatefulBaseLifeCycle
Passivate method.

Specified by:
saveState in interface StatefulBaseLifeCycle

readState

public void readState()
Description copied from interface: StatefulBaseLifeCycle
Activate method.

Specified by:
readState in interface StatefulBaseLifeCycle

getIconAltMap

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

Specified by:
getIconAltMap in interface SecurityActions

getIconPathMap

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

Specified by:
getIconPathMap in interface SecurityActions

getBlockRightInheritance

public java.lang.Boolean getBlockRightInheritance()
Specified by:
getBlockRightInheritance in interface SecurityActions

setBlockRightInheritance

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

displayInheritedPermissions

public java.lang.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 java.util.List<java.lang.String> getCurrentDocumentUsers()
                                                         throws ClientException
Specified by:
getCurrentDocumentUsers in interface SecurityActions
Throws:
ClientException

getParentDocumentsUsers

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

getSelectedEntry

public java.lang.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(java.lang.String selectedEntry)
Description copied from interface: SecurityActions
Sets selected entry used in add/remove methods

Specified by:
setSelectedEntry in interface SecurityActions

getSelectedEntries

public java.util.List<java.lang.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(java.util.List<java.lang.String> selectedEntries)
Description copied from interface: SecurityActions
Sets selected entries used in add/remove methods

Specified by:
setSelectedEntries in interface SecurityActions

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.