@Name(value="securityActions") @Scope(value=CONVERSATION) public class SecurityActionsBean extends InputController implements SecurityActions, Serializable
Modifier and Type | Field and Description |
---|---|
protected String[] |
CACHED_PERMISSION_TO_CHECK |
protected List<String> |
cachedDeletedUserAndGroups |
protected List<String> |
cachedValidatedUserAndGroups |
protected NuxeoPrincipal |
currentUser |
protected CoreSession |
documentManager |
protected PageSelections<String> |
entries |
protected NavigationContext |
navigationContext |
protected boolean |
obsoleteSecurityData |
protected PermissionActionListManager |
permissionActionListManager |
protected PermissionListManager |
permissionListManager |
protected PrincipalListManager |
principalListManager |
protected SecurityData |
securityData |
protected static String[] |
SEED_PERMISSIONS_TO_CHECK |
protected List<String> |
selectedEntries |
protected String |
selectedEntry |
protected UserManager |
userManager |
actionManager, currentDocument, eventManager, facesMessages, resourcesAccessor, typeManager, typesTool
Constructor and Description |
---|
SecurityActionsBean() |
Modifier and Type | Method and Description |
---|---|
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()> . |
protected List<javax.faces.model.SelectItem> |
asSelectItems(String... permissions) |
String |
blockRightInheritance() |
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() |
PageSelections<String> |
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.
|
String |
getLabel(String permission) |
List<String> |
getParentDocumentsUsers() |
protected String[] |
getPermissionsToCheck() |
Map<String,String> |
getPermissionsToLabels()
Returns a Map containing all contributed permissions and their associated labels.
|
SecurityData |
getSecurityData() |
List<String> |
getSelectedEntries()
Returns selected entries used in add/remove methods
|
String |
getSelectedEntry()
Returns selected entry used in add/remove methods
|
List<javax.faces.model.SelectItem> |
getSettablePermissions() |
List<javax.faces.model.SelectItem> |
getUserVisiblePermissionSelectItems(String documentType) |
List<UserVisiblePermission> |
getVisibleUserPermissions(String documentType) |
boolean |
isMSIEorEdge() |
void |
rebuildSecurityData()
Rebuilds the security displayable data from the current selected document.
|
protected void |
reconstructTableModel()
Update the dataTableModel from the current
SecurityData this method is automatically called by
rebuildSecurityData method |
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.
|
computeOutcome, extractReferences, getAdministrator, logDocumentWithName, logDocumentWithTitle, removeDocumentFromList, setFacesMessage
@In(create=true) protected transient NavigationContext navigationContext
@In(create=true, required=false) protected transient CoreSession documentManager
@In(create=true) protected PermissionActionListManager permissionActionListManager
@In(create=true) protected PermissionListManager permissionListManager
@In(create=true) protected PrincipalListManager principalListManager
@In(create=true) protected transient UserManager userManager
@In(create=true) protected NuxeoPrincipal currentUser
protected static final String[] SEED_PERMISSIONS_TO_CHECK
protected String[] CACHED_PERMISSION_TO_CHECK
protected SecurityData securityData
protected boolean obsoleteSecurityData
protected PageSelections<String> entries
protected transient List<String> cachedValidatedUserAndGroups
protected transient List<String> cachedDeletedUserAndGroups
protected String selectedEntry
protected List<String> selectedEntries
public SecurityActionsBean()
@Observer(value="userAllDocumentTypesSelectionChanged", create=false) @BypassInterceptors public void resetSecurityData()
SecurityActions
resetSecurityData
in interface SecurityActions
public void rebuildSecurityData()
SecurityActions
rebuildSecurityData
in interface SecurityActions
protected void reconstructTableModel()
SecurityData
this method is automatically called by
rebuildSecurityData methodpublic PageSelections<String> getDataTableModel()
getDataTableModel
in interface SecurityActions
public SecurityData getSecurityData()
getSecurityData
in interface SecurityActions
public String updateSecurityOnDocument()
SecurityActions
updateSecurityOnDocument
in interface SecurityActions
public String addPermission(String principalName, String permissionName, boolean grant)
addPermission
in interface SecurityActions
public String addPermission()
SecurityActions
updateSecurityOnDocument()>
.addPermission
in interface SecurityActions
public String addPermissions()
SecurityActions
updateSecurityOnDocument()>
.addPermissions
in interface SecurityActions
public String addPermissionAndUpdate()
SecurityActions
updateSecurityOnDocument()>
.addPermissionAndUpdate
in interface SecurityActions
public String addPermissionsAndUpdate()
SecurityActions
updateSecurityOnDocument()>
.addPermissionsAndUpdate
in interface SecurityActions
public String saveSecurityUpdates()
saveSecurityUpdates
in interface SecurityActions
public String removePermission()
SecurityActions
updateSecurityOnDocument()>
.removePermission
in interface SecurityActions
public String removePermissionAndUpdate()
SecurityActions
updateSecurityOnDocument()>
.removePermissionAndUpdate
in interface SecurityActions
public String removePermissions()
removePermissions
in interface SecurityActions
public String removePermissionsAndUpdate()
removePermissionsAndUpdate
in interface SecurityActions
public boolean getCanAddSecurityRules()
SecurityActions
getCanAddSecurityRules
in interface SecurityActions
public boolean getCanRemoveSecurityRules()
SecurityActions
getCanRemoveSecurityRules
in interface SecurityActions
public List<UserVisiblePermission> getVisibleUserPermissions(String documentType)
public List<javax.faces.model.SelectItem> getSettablePermissions()
getSettablePermissions
in interface SecurityActions
protected List<javax.faces.model.SelectItem> asSelectItems(String... permissions)
public List<javax.faces.model.SelectItem> getUserVisiblePermissionSelectItems(String documentType)
public Map<String,String> getIconAltMap()
SecurityActions
getIconAltMap
in interface SecurityActions
public Map<String,String> getIconPathMap()
SecurityActions
getIconPathMap
in interface SecurityActions
public Boolean getBlockRightInheritance()
getBlockRightInheritance
in interface SecurityActions
public void setBlockRightInheritance(Boolean blockRightInheritance)
setBlockRightInheritance
in interface SecurityActions
public String blockRightInheritance()
public Boolean displayInheritedPermissions()
displayInheritedPermissions
in interface SecurityActions
public boolean getDisplayInheritedPermissions()
SecurityActions
getDisplayInheritedPermissions
in interface SecurityActions
public List<String> getCurrentDocumentUsers()
getCurrentDocumentUsers
in interface SecurityActions
public List<String> getParentDocumentsUsers()
getParentDocumentsUsers
in interface SecurityActions
protected String[] getPermissionsToCheck()
public String getSelectedEntry()
SecurityActions
getSelectedEntry
in interface SecurityActions
public void setSelectedEntry(String selectedEntry)
SecurityActions
setSelectedEntry
in interface SecurityActions
public List<String> getSelectedEntries()
SecurityActions
getSelectedEntries
in interface SecurityActions
public void setSelectedEntries(List<String> selectedEntries)
SecurityActions
setSelectedEntries
in interface SecurityActions
@Factory(value="isMSIEorEdge", scope=SESSION) public boolean isMSIEorEdge()
public Map<String,String> getPermissionsToLabels()
Copyright © 2017 Nuxeo. All rights reserved.