Class BundleUIAccessRightService
- java.lang.Object
-
- de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
-
- de.hybris.platform.cockpit.services.security.impl.DefaultUIAccessRightService
-
- de.hybris.platform.configurablebundlecockpits.admincockpit.services.security.impl.BundleUIAccessRightService
-
- All Implemented Interfaces:
UIAccessRightService
public class BundleUIAccessRightService extends DefaultUIAccessRightService
Extends theDefaultUIAccessRightService
to add/evaluate a generic handling for the display (writable or not) of an attribute that is dependent on the another attribute (null or not null) of the same type, e.g. the attribute 'description' of an item is only writable if the attribute 'name' is not null. The list of dependencies is injected via Spring.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.cockpit.services.security.impl.DefaultUIAccessRightService
cockpitUIComponentAccessRightDao
-
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService
-
-
Constructor Summary
Constructors Constructor Description BundleUIAccessRightService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fillDependencyMap()
Creates a map based on the injected list of dependencies.protected java.util.List<UIAccessRightDependency>
getDependencies()
protected boolean
isAttributeWritable(TypedObject item, UIAccessRightDependency dependency)
boolean
isWritable(ObjectType type, TypedObject item, PropertyDescriptor propDescr, boolean creationMode)
Overrides the super method to evaluate the injected list of dependencies before the standard method is called.void
setDependencies(java.util.List<UIAccessRightDependency> dependencies)
-
Methods inherited from class de.hybris.platform.cockpit.services.security.impl.DefaultUIAccessRightService
canRead, canWrite, canWrite, getBaseTypeCode, getSessionContext, getSystemService, getUserService, isReadable, isReadable, isWritable, isWritable, isWritable, restricts, setCockpitUIComponentAccessRightDao, setSystemService, setUserService
-
Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
-
-
-
Method Detail
-
isWritable
public boolean isWritable(ObjectType type, TypedObject item, PropertyDescriptor propDescr, boolean creationMode)
Overrides the super method to evaluate the injected list of dependencies before the standard method is called.- Specified by:
isWritable
in interfaceUIAccessRightService
- Overrides:
isWritable
in classDefaultUIAccessRightService
- Parameters:
type
- item typeitem
- item instancepropDescr
- item attribute to check access forcreationMode
- creation mode or not- Returns:
true
if user has write access,false
otherwise
-
isAttributeWritable
protected boolean isAttributeWritable(TypedObject item, UIAccessRightDependency dependency)
-
fillDependencyMap
protected void fillDependencyMap()
Creates a map based on the injected list of dependencies. It is checked if the attributes that are provided by the list do exist. In case an attribute is not defined in the system it is ignored.
-
getDependencies
protected java.util.List<UIAccessRightDependency> getDependencies()
-
setDependencies
public void setDependencies(java.util.List<UIAccessRightDependency> dependencies)
-
-