Class DefaultPermissionFacade
- java.lang.Object
-
- com.hybris.cockpitng.dataaccess.facades.permissions.impl.DefaultPermissionFacade
-
- All Implemented Interfaces:
PermissionFacade
public class DefaultPermissionFacade extends java.lang.Object implements PermissionFacade
Implementation that returns true for all method calls.
-
-
Constructor Summary
Constructors Constructor Description DefaultPermissionFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanChangeInstance(java.lang.Object instance)Returns true if the current user is allowed to change this instance.booleancanChangeInstanceProperty(java.lang.Object instance, java.lang.String property)Returns true if the current user is allowed to change the specified property at the given instance.booleancanChangeInstances(java.util.Collection<java.lang.Object> instances)Returns true if the current user is allowed to change all instances.booleancanChangeInstancesProperty(java.util.Collection<java.lang.Object> instances, java.lang.String qualifier)Returns true if the current user is granted change permission to the given property.booleancanChangeProperty(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted change permission to the given property.booleancanChangePropertyPermission(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted "change permission" permission to the given property.booleancanChangeType(java.lang.String typeCode)Returns true if the current user is granted change permission to the given type.booleancanChangeTypePermission(java.lang.String typeCode)Returns true if the current user is granted "change permission" permission to the given type.booleancanCreateTypeInstance(java.lang.String typeCode)Returns true if the current user is granted create permission to instances of the given type.booleancanReadInstance(java.lang.Object instance)Returns true if the current user is allowed to read this instance.booleancanReadInstanceProperty(java.lang.Object instance, java.lang.String property)Returns true if the current user is allowed to read the specified property at the given instance.booleancanReadProperty(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted read permission to the given property.booleancanReadType(java.lang.String typeCode)Returns true if the current user is granted read permission to the given type.booleancanRemoveInstance(java.lang.Object instance)Returns true if the current user is allowed to delete this instance.booleancanRemoveTypeInstance(java.lang.String typeCode)Returns true if the current user is granted delete permission to an instance of the given type.java.util.Set<java.util.Locale>getAllReadableLocalesForCurrentUser()Returns a set of locales for which the current user has permission to read localized property values.java.util.Set<java.util.Locale>getAllWritableLocalesForCurrentUser()Returns a set of locales for which the current user has permission to write localized property values of given instance.java.util.Set<java.util.Locale>getEnabledReadableLocalesForCurrentUser()Returns a set of enabled locales for which the current user has permission to read localized property values.java.util.Set<java.util.Locale>getEnabledWritableLocalesForCurrentUser()Returns a set of enabled locales for which the current user has permission to write localized property values of given instance.java.util.Set<java.util.Locale>getReadableLocalesForInstance(java.lang.Object instance)Returns a set of locales for which the current user has permission to read localized property values of given instance.java.util.Set<java.util.Locale>getWritableLocalesForInstance(java.lang.Object instance)Returns a set of locales for which the current user has permission to write localized property values of given instance.voidsetDefaultAccess(boolean defaultAccess)voidsetPermissionFacadeStrategyRegistry(PermissionFacadeStrategyRegistry permissionFacadeStrategyRegistry)
-
-
-
Method Detail
-
canReadType
public boolean canReadType(java.lang.String typeCode)
Description copied from interface:PermissionFacadeReturns true if the current user is granted read permission to the given type. Returns false otherwise.- Specified by:
canReadTypein interfacePermissionFacade- Parameters:
typeCode- type- Returns:
- true if user has read permission, false otherwise
-
canReadProperty
public boolean canReadProperty(java.lang.String typeCode, java.lang.String property)Description copied from interface:PermissionFacadeReturns true if the current user is granted read permission to the given property. Returns false otherwise. You should always prefer usingPermissionFacade.canReadInstanceProperty(Object, String)if there is an instance available.- Specified by:
canReadPropertyin interfacePermissionFacade- Parameters:
typeCode- type of object which property is readproperty- property of object- Returns:
- true if user has read permission, false otherwise
-
canChangeType
public boolean canChangeType(java.lang.String typeCode)
Description copied from interface:PermissionFacadeReturns true if the current user is granted change permission to the given type. Returns false otherwise.- Specified by:
canChangeTypein interfacePermissionFacade- Parameters:
typeCode- type- Returns:
- true if user has change permission, false otherwise
-
canChangeProperty
public boolean canChangeProperty(java.lang.String typeCode, java.lang.String property)Description copied from interface:PermissionFacadeReturns true if the current user is granted change permission to the given property. Returns false otherwise. You should always prefer usingPermissionFacade.canChangeInstanceProperty(Object, String)if there is an instance available.- Specified by:
canChangePropertyin interfacePermissionFacade- Parameters:
typeCode- type of object which property is changeproperty- property of object- Returns:
- true if user has change permission, false otherwise
-
canCreateTypeInstance
public boolean canCreateTypeInstance(java.lang.String typeCode)
Description copied from interface:PermissionFacadeReturns true if the current user is granted create permission to instances of the given type. Returns false otherwise.- Specified by:
canCreateTypeInstancein interfacePermissionFacade- Parameters:
typeCode- type- Returns:
- true if user has create permission, false otherwise
-
canRemoveTypeInstance
public boolean canRemoveTypeInstance(java.lang.String typeCode)
Description copied from interface:PermissionFacadeReturns true if the current user is granted delete permission to an instance of the given type. Returns false otherwise. You should always prefer usingPermissionFacade.canRemoveInstance(Object)if there is an instance available.- Specified by:
canRemoveTypeInstancein interfacePermissionFacade- Parameters:
typeCode- type of object- Returns:
- true if user has delete permission, false otherwise
-
canChangeTypePermission
public boolean canChangeTypePermission(java.lang.String typeCode)
Description copied from interface:PermissionFacadeReturns true if the current user is granted "change permission" permission to the given type. Returns false otherwise.- Specified by:
canChangeTypePermissionin interfacePermissionFacade- Parameters:
typeCode- type of object- Returns:
- true if user has change permission, false otherwise
-
canChangePropertyPermission
public boolean canChangePropertyPermission(java.lang.String typeCode, java.lang.String property)Description copied from interface:PermissionFacadeReturns true if the current user is granted "change permission" permission to the given property. Returns false otherwise.- Specified by:
canChangePropertyPermissionin interfacePermissionFacade- Parameters:
typeCode- type of objectproperty- property to change- Returns:
- true if user has change permission, false otherwise
-
getReadableLocalesForInstance
public java.util.Set<java.util.Locale> getReadableLocalesForInstance(java.lang.Object instance)
Description copied from interface:PermissionFacadeReturns a set of locales for which the current user has permission to read localized property values of given instance. Returns null, if no restrictions are set.- Specified by:
getReadableLocalesForInstancein interfacePermissionFacade- Parameters:
instance- object to read localized property- Returns:
- set o locales on which user has read permission
-
getWritableLocalesForInstance
public java.util.Set<java.util.Locale> getWritableLocalesForInstance(java.lang.Object instance)
Description copied from interface:PermissionFacadeReturns a set of locales for which the current user has permission to write localized property values of given instance. Returns null, if no restrictions are set.- Specified by:
getWritableLocalesForInstancein interfacePermissionFacade- Parameters:
instance- object to write localized property- Returns:
- set o locales on which user has write permission
-
canReadInstanceProperty
public boolean canReadInstanceProperty(java.lang.Object instance, java.lang.String property)Description copied from interface:PermissionFacadeReturns true if the current user is allowed to read the specified property at the given instance. This usually includes a type check, seePermissionFacade.canChangeProperty(String, String).- Specified by:
canReadInstancePropertyin interfacePermissionFacade- Parameters:
instance- object which property is readproperty- property of object- Returns:
- true if user has read permission, false otherwise
-
canChangeInstanceProperty
public boolean canChangeInstanceProperty(java.lang.Object instance, java.lang.String property)Description copied from interface:PermissionFacadeReturns true if the current user is allowed to change the specified property at the given instance. This usually includes a type check, seePermissionFacade.canChangeProperty(String, String).- Specified by:
canChangeInstancePropertyin interfacePermissionFacade- Parameters:
instance- object which property is changeproperty- property of object- Returns:
- true if user has change permission, false otherwise
-
canChangeInstancesProperty
public boolean canChangeInstancesProperty(java.util.Collection<java.lang.Object> instances, java.lang.String qualifier)Description copied from interface:PermissionFacadeReturns true if the current user is granted change permission to the given property. Returns false otherwise.- Specified by:
canChangeInstancesPropertyin interfacePermissionFacade- Parameters:
instances- objects to changequalifier- property of objects- Returns:
- true if user has change permission, false otherwise
-
canRemoveInstance
public boolean canRemoveInstance(java.lang.Object instance)
Description copied from interface:PermissionFacadeReturns true if the current user is allowed to delete this instance. This usually includes a type check, seePermissionFacade.canRemoveTypeInstance(String).- Specified by:
canRemoveInstancein interfacePermissionFacade- Parameters:
instance- object to delete- Returns:
- true if user has delete permission, false otherwise
-
canReadInstance
public boolean canReadInstance(java.lang.Object instance)
Description copied from interface:PermissionFacadeReturns true if the current user is allowed to read this instance. Returns false otherwise.- Specified by:
canReadInstancein interfacePermissionFacade- Parameters:
instance- object to read- Returns:
- true if user has read permission, false otherwise
-
canChangeInstance
public boolean canChangeInstance(java.lang.Object instance)
Description copied from interface:PermissionFacadeReturns true if the current user is allowed to change this instance. Returns false otherwise.- Specified by:
canChangeInstancein interfacePermissionFacade- Parameters:
instance- object to change- Returns:
- true if user has change permission, false otherwise
-
canChangeInstances
public boolean canChangeInstances(java.util.Collection<java.lang.Object> instances)
Description copied from interface:PermissionFacadeReturns true if the current user is allowed to change all instances. Returns false otherwise.- Specified by:
canChangeInstancesin interfacePermissionFacade- Parameters:
instances- objects to change- Returns:
- true if user has change permission, false otherwise
-
getAllReadableLocalesForCurrentUser
public java.util.Set<java.util.Locale> getAllReadableLocalesForCurrentUser()
Description copied from interface:PermissionFacadeReturns a set of locales for which the current user has permission to read localized property values. Returns null, if no restrictions are set.- Specified by:
getAllReadableLocalesForCurrentUserin interfacePermissionFacade- Returns:
- set o locales on which user has read permission
-
getAllWritableLocalesForCurrentUser
public java.util.Set<java.util.Locale> getAllWritableLocalesForCurrentUser()
Description copied from interface:PermissionFacadeReturns a set of locales for which the current user has permission to write localized property values of given instance. Returns null, if no restrictions are set.- Specified by:
getAllWritableLocalesForCurrentUserin interfacePermissionFacade- Returns:
- set o locales on which user has write permission
-
getEnabledReadableLocalesForCurrentUser
public java.util.Set<java.util.Locale> getEnabledReadableLocalesForCurrentUser()
Description copied from interface:PermissionFacadeReturns a set of enabled locales for which the current user has permission to read localized property values. Returns empty set, if no restrictions are set.- Specified by:
getEnabledReadableLocalesForCurrentUserin interfacePermissionFacade- Returns:
- set o enabled locales on which user has read permission
-
getEnabledWritableLocalesForCurrentUser
public java.util.Set<java.util.Locale> getEnabledWritableLocalesForCurrentUser()
Description copied from interface:PermissionFacadeReturns a set of enabled locales for which the current user has permission to write localized property values of given instance. Returns empty set, if no restrictions are set.- Specified by:
getEnabledWritableLocalesForCurrentUserin interfacePermissionFacade- Returns:
- set o locales on which user has write permission
-
setPermissionFacadeStrategyRegistry
public void setPermissionFacadeStrategyRegistry(PermissionFacadeStrategyRegistry permissionFacadeStrategyRegistry)
-
setDefaultAccess
public void setDefaultAccess(boolean defaultAccess)
-
-