Class DefaultUIAccessRightService
- java.lang.Object
-
- de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
-
- de.hybris.platform.cockpit.services.security.impl.DefaultUIAccessRightService
-
- All Implemented Interfaces:
UIAccessRightService
- Direct Known Subclasses:
BundleUIAccessRightService
public class DefaultUIAccessRightService extends AbstractServiceImpl implements UIAccessRightService
Default implementation of the ui access right service.
-
-
Field Summary
Fields Modifier and Type Field Description protected CockpitUIComponentAccessRightDao
cockpitUIComponentAccessRightDao
-
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService
-
-
Constructor Summary
Constructors Constructor Description DefaultUIAccessRightService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRead(UserModel user, java.lang.String componentCode)
Returns whether a specific user has read access to a specific Cockpit component or not.boolean
canWrite(UserModel user, CatalogVersionModel catVersion)
Returns whether a specific user has write access to a specific catalog version or not.boolean
canWrite(UserModel user, java.lang.String componentCode)
Returns whether a specific user has write access to a specific Cockpit component or not.protected java.lang.String
getBaseTypeCode(ObjectType type, ItemAttributePropertyDescriptor descr)
protected SessionContext
getSessionContext()
SystemService
getSystemService()
UserService
getUserService()
boolean
isReadable(ObjectType type)
Returns whether the current user has read access to the specified type.boolean
isReadable(ObjectType type, PropertyDescriptor propDescr, boolean creationMode)
Returns whether the current user has read access to the specified property.boolean
isWritable(ObjectType type)
Returns whether the current user has write access to the specified type.boolean
isWritable(ObjectType type, PropertyDescriptor propDescr, boolean creationMode)
Returns whether the current user has write access to the specified item property.boolean
isWritable(ObjectType type, TypedObject item)
Returns whether the current user has write access to the specified item.boolean
isWritable(ObjectType type, TypedObject item, PropertyDescriptor propDescr, boolean creationMode)
Returns whether the current user has write access to the specified item property.protected boolean
restricts(java.util.Collection<PrincipalModel> principals, UserModel user)
void
setCockpitUIComponentAccessRightDao(CockpitUIComponentAccessRightDao cockpitUIComponentAccessRightDao)
void
setSystemService(SystemService systemService)
void
setUserService(UserService userService)
-
Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
-
-
-
Field Detail
-
cockpitUIComponentAccessRightDao
protected CockpitUIComponentAccessRightDao cockpitUIComponentAccessRightDao
-
-
Method Detail
-
canRead
public boolean canRead(UserModel user, java.lang.String componentCode)
Description copied from interface:UIAccessRightService
Returns whether a specific user has read access to a specific Cockpit component or not.- Specified by:
canRead
in interfaceUIAccessRightService
- Parameters:
user
- the user to check access forcomponentCode
- the unique code of the component- Returns:
true
if the user has read access to the specified component, otherwisefalse
-
canWrite
public boolean canWrite(UserModel user, java.lang.String componentCode)
Description copied from interface:UIAccessRightService
Returns whether a specific user has write access to a specific Cockpit component or not.- Specified by:
canWrite
in interfaceUIAccessRightService
- Parameters:
user
- the user to check access forcomponentCode
- the unique code of the component- Returns:
true
if the user has write access to the specified component, otherwisefalse
-
restricts
protected boolean restricts(java.util.Collection<PrincipalModel> principals, UserModel user)
-
setCockpitUIComponentAccessRightDao
public void setCockpitUIComponentAccessRightDao(CockpitUIComponentAccessRightDao cockpitUIComponentAccessRightDao)
-
setUserService
public void setUserService(UserService userService)
-
getUserService
public UserService getUserService()
-
isReadable
public boolean isReadable(ObjectType type)
Description copied from interface:UIAccessRightService
Returns whether the current user has read access to the specified type.- Specified by:
isReadable
in interfaceUIAccessRightService
- Parameters:
type
- the type to check access for- Returns:
true
if user has read access,false
otherwise
-
isReadable
public boolean isReadable(ObjectType type, PropertyDescriptor propDescr, boolean creationMode)
Description copied from interface:UIAccessRightService
Returns whether the current user has read access to the specified property.- Specified by:
isReadable
in interfaceUIAccessRightService
- Parameters:
type
- item typepropDescr
- item attribute to check access forcreationMode
- creation mode or not- Returns:
true
if user has read access,false
otherwise
-
isWritable
public boolean isWritable(ObjectType type)
Description copied from interface:UIAccessRightService
Returns whether the current user has write access to the specified type.- Specified by:
isWritable
in interfaceUIAccessRightService
- Parameters:
type
- the type to check access for- Returns:
true
if user has write access,false
otherwise
-
isWritable
public boolean isWritable(ObjectType type, TypedObject item)
Description copied from interface:UIAccessRightService
Returns whether the current user has write access to the specified item.- Specified by:
isWritable
in interfaceUIAccessRightService
- Parameters:
type
- item typeitem
- the item instance to check access for- Returns:
true
if user has write access,false
otherwise
-
isWritable
public boolean isWritable(ObjectType type, TypedObject item, PropertyDescriptor propDescr, boolean creationMode)
Description copied from interface:UIAccessRightService
Returns whether the current user has write access to the specified item property.- Specified by:
isWritable
in interfaceUIAccessRightService
- 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
-
isWritable
public boolean isWritable(ObjectType type, PropertyDescriptor propDescr, boolean creationMode)
Description copied from interface:UIAccessRightService
Returns whether the current user has write access to the specified item property.- Specified by:
isWritable
in interfaceUIAccessRightService
- Parameters:
type
- item typepropDescr
- item attribute to check access forcreationMode
- creation mode or not- Returns:
true
if user has write access,false
otherwise
-
getBaseTypeCode
protected java.lang.String getBaseTypeCode(ObjectType type, ItemAttributePropertyDescriptor descr)
-
setSystemService
public void setSystemService(SystemService systemService)
-
getSystemService
public SystemService getSystemService()
-
canWrite
public boolean canWrite(UserModel user, CatalogVersionModel catVersion)
Description copied from interface:UIAccessRightService
Returns whether a specific user has write access to a specific catalog version or not.- Specified by:
canWrite
in interfaceUIAccessRightService
- Parameters:
user
- the user to check access forcatVersion
- the catalog version- Returns:
true
if the user has write access,false
otherwise
-
getSessionContext
protected SessionContext getSessionContext()
-
-