Interface ModelSecurityService
-
- All Known Implementing Classes:
ModelSecurityServiceImpl
@AlfrescoPublicApi public interface ModelSecurityService
Model security service interface.- Since:
- 2.1
- Author:
- Roy Wetherall
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canEditProtectedAspect(NodeRef nodeRef, QName aspect)
Indicates whether the current user can edit (ie add or remove) a protected aspect in the context of a given node.boolean
canEditProtectedProperty(NodeRef nodeRef, QName property)
Indicates whether the current user can edit a protected property in the context of a given node.void
disable()
Disable model security checks for the current thread.void
enable()
Enable model security checks for the current thread.ProtectedAspect
getProtectedAspect(QName name)
Get the details of the protected aspect, returns null if aspect is not protected.Set<QName>
getProtectedAspects()
Get the protected aspects.Set<QName>
getProtectedProperties()
Get the protected propertiesProtectedProperty
getProtectedProperty(QName name)
Get the details of the protected property, returns null if property is not protected.boolean
isEnabled()
Indicates whether model security is enabled or not.boolean
isProtectedAspect(QName aspect)
Indicates whether an aspect is protected or not.boolean
isProtectedProperty(QName property)
Indicates whether a property is protected or not.void
register(ProtectedModelArtifact atrifact)
Registers a protected model artifact with the service.void
setEnabled(boolean enabled)
Sets whether model security is enabled globally or not.
-
-
-
Method Detail
-
setEnabled
void setEnabled(boolean enabled)
Sets whether model security is enabled globally or not.- Parameters:
enabled
-
-
isEnabled
boolean isEnabled()
Indicates whether model security is enabled or not.- Returns:
-
disable
void disable()
Disable model security checks for the current thread.
-
enable
void enable()
Enable model security checks for the current thread.
-
register
void register(ProtectedModelArtifact atrifact)
Registers a protected model artifact with the service.- Parameters:
atrifact
- protected model artifact
-
isProtectedProperty
boolean isProtectedProperty(QName property)
Indicates whether a property is protected or not.- Parameters:
property
- name of property- Returns:
- boolean true if property is protected, false otherwise
-
getProtectedProperty
ProtectedProperty getProtectedProperty(QName name)
Get the details of the protected property, returns null if property is not protected.- Parameters:
name
- name of the protected property- Returns:
ProtectedProperty
protected property details, null otherwise
-
canEditProtectedProperty
boolean canEditProtectedProperty(NodeRef nodeRef, QName property)
Indicates whether the current user can edit a protected property in the context of a given node.If the property is not protected then returns true.
- Parameters:
nodeRef
- node referenceproperty
- name of the property- Returns:
- boolean true if the current user can edit the protected property or the property is not protected, false otherwise
-
isProtectedAspect
boolean isProtectedAspect(QName aspect)
Indicates whether an aspect is protected or not.- Parameters:
aspect
- aspect name- Returns:
- boolean true if aspect is protected, false otherwise
-
getProtectedAspect
ProtectedAspect getProtectedAspect(QName name)
Get the details of the protected aspect, returns null if aspect is not protected.- Parameters:
name
- name of the aspect- Returns:
ProtectedAspect
protected aspect details, null otherwise
-
canEditProtectedAspect
boolean canEditProtectedAspect(NodeRef nodeRef, QName aspect)
Indicates whether the current user can edit (ie add or remove) a protected aspect in the context of a given node.If the aspect is not protected then returns true.
- Parameters:
nodeRef
- node referenceaspect
- name of the of aspect- Returns:
- boolean true if the current user can edit the protected aspect or the the aspect is not protected, false otherwise
-
-