Interface PermissionFacade
-
- All Known Subinterfaces:
PermissionFacadeStrategy
- All Known Implementing Classes:
DefaultPermissionFacade
public interface PermissionFacadeProvides methods for checking CRUD permissions on type and property level.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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.default booleancanChangeInstances(java.util.Collection<java.lang.Object> instances)Returns true if the current user is allowed to change all instances.default booleancanChangeInstancesProperty(java.util.Collection<java.lang.Object> instances, java.lang.String property)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.default 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.default 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.
-
-
-
Method Detail
-
canReadType
boolean canReadType(java.lang.String typeCode)
Returns true if the current user is granted read permission to the given type. Returns false otherwise.- Parameters:
typeCode- type- Returns:
- true if user has read permission, false otherwise
-
canChangeType
boolean canChangeType(java.lang.String typeCode)
Returns true if the current user is granted change permission to the given type. Returns false otherwise.- Parameters:
typeCode- type- Returns:
- true if user has change permission, false otherwise
-
canReadInstanceProperty
boolean canReadInstanceProperty(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. This usually includes a type check, seecanChangeProperty(String, String).- Parameters:
instance- object which property is readproperty- property of object- Returns:
- true if user has read permission, false otherwise
-
canReadProperty
boolean canReadProperty(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted read permission to the given property. Returns false otherwise. You should always prefer usingcanReadInstanceProperty(Object, String)if there is an instance available.- Parameters:
typeCode- type of object which property is readproperty- property of object- Returns:
- true if user has read permission, false otherwise
-
canChangeInstanceProperty
boolean canChangeInstanceProperty(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. This usually includes a type check, seecanChangeProperty(String, String).- Parameters:
instance- object which property is changeproperty- property of object- Returns:
- true if user has change permission, false otherwise
-
canChangeProperty
boolean canChangeProperty(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted change permission to the given property. Returns false otherwise. You should always prefer usingcanChangeInstanceProperty(Object, String)if there is an instance available.- Parameters:
typeCode- type of object which property is changeproperty- property of object- Returns:
- true if user has change permission, false otherwise
-
canCreateTypeInstance
boolean canCreateTypeInstance(java.lang.String typeCode)
Returns true if the current user is granted create permission to instances of the given type. Returns false otherwise.- Parameters:
typeCode- type- Returns:
- true if user has create permission, false otherwise
-
canRemoveInstance
boolean canRemoveInstance(java.lang.Object instance)
Returns true if the current user is allowed to delete this instance. This usually includes a type check, seecanRemoveTypeInstance(String).- Parameters:
instance- object to delete- Returns:
- true if user has delete permission, false otherwise
-
canReadInstance
boolean canReadInstance(java.lang.Object instance)
Returns true if the current user is allowed to read this instance. Returns false otherwise.- Parameters:
instance- object to read- Returns:
- true if user has read permission, false otherwise
-
canChangeInstance
boolean canChangeInstance(java.lang.Object instance)
Returns true if the current user is allowed to change this instance. Returns false otherwise.- Parameters:
instance- object to change- Returns:
- true if user has change permission, false otherwise
-
canChangeInstances
default boolean canChangeInstances(java.util.Collection<java.lang.Object> instances)
Returns true if the current user is allowed to change all instances. Returns false otherwise.- Parameters:
instances- objects to change- Returns:
- true if user has change permission, false otherwise
-
canChangeInstancesProperty
default boolean canChangeInstancesProperty(java.util.Collection<java.lang.Object> instances, java.lang.String property)Returns true if the current user is granted change permission to the given property. Returns false otherwise.- Parameters:
instances- objects to changeproperty- property of objects- Returns:
- true if user has change permission, false otherwise
-
canRemoveTypeInstance
boolean canRemoveTypeInstance(java.lang.String typeCode)
Returns true if the current user is granted delete permission to an instance of the given type. Returns false otherwise. You should always prefer usingcanRemoveInstance(Object)if there is an instance available.- Parameters:
typeCode- type of object- Returns:
- true if user has delete permission, false otherwise
-
canChangeTypePermission
boolean canChangeTypePermission(java.lang.String typeCode)
Returns true if the current user is granted "change permission" permission to the given type. Returns false otherwise.- Parameters:
typeCode- type of object- Returns:
- true if user has change permission, false otherwise
-
canChangePropertyPermission
boolean canChangePropertyPermission(java.lang.String typeCode, java.lang.String property)Returns true if the current user is granted "change permission" permission to the given property. Returns false otherwise.- Parameters:
typeCode- type of objectproperty- property to change- Returns:
- true if user has change permission, false otherwise
-
getReadableLocalesForInstance
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. Returns null, if no restrictions are set.- Parameters:
instance- object to read localized property- Returns:
- set o locales on which user has read permission
-
getWritableLocalesForInstance
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. Returns null, if no restrictions are set.- Parameters:
instance- object to write localized property- Returns:
- set o locales on which user has write permission
-
getAllReadableLocalesForCurrentUser
java.util.Set<java.util.Locale> getAllReadableLocalesForCurrentUser()
Returns a set of locales for which the current user has permission to read localized property values. Returns null, if no restrictions are set.- Returns:
- set o locales on which user has read permission
-
getAllWritableLocalesForCurrentUser
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. Returns null, if no restrictions are set.- Returns:
- set o locales on which user has write permission
-
getEnabledReadableLocalesForCurrentUser
default 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. Returns empty set, if no restrictions are set.- Returns:
- set o enabled locales on which user has read permission
-
getEnabledWritableLocalesForCurrentUser
default 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. Returns empty set, if no restrictions are set.- Returns:
- set o locales on which user has write permission
-
-