Interface PermissionFacade

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean canChangeInstance​(java.lang.Object instance)
      Returns true if the current user is allowed to change this instance.
      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.
      default boolean canChangeInstances​(java.util.Collection<java.lang.Object> instances)
      Returns true if the current user is allowed to change all instances.
      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.
      boolean canChangeProperty​(java.lang.String typeCode, java.lang.String property)
      Returns true if the current user is granted change permission to the given property.
      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.
      boolean canChangeType​(java.lang.String typeCode)
      Returns true if the current user is granted change permission to the given type.
      boolean canChangeTypePermission​(java.lang.String typeCode)
      Returns true if the current user is granted "change permission" permission to the given type.
      boolean canCreateTypeInstance​(java.lang.String typeCode)
      Returns true if the current user is granted create permission to instances of the given type.
      boolean canReadInstance​(java.lang.Object instance)
      Returns true if the current user is allowed to read this instance.
      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.
      boolean canReadProperty​(java.lang.String typeCode, java.lang.String property)
      Returns true if the current user is granted read permission to the given property.
      boolean canReadType​(java.lang.String typeCode)
      Returns true if the current user is granted read permission to the given type.
      boolean canRemoveInstance​(java.lang.Object instance)
      Returns true if the current user is allowed to delete this instance.
      boolean canRemoveTypeInstance​(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, see canChangeProperty(String, String).
        Parameters:
        instance - object which property is read
        property - 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 using canReadInstanceProperty(Object, String) if there is an instance available.
        Parameters:
        typeCode - type of object which property is read
        property - 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, see canChangeProperty(String, String).
        Parameters:
        instance - object which property is change
        property - 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 using canChangeInstanceProperty(Object, String) if there is an instance available.
        Parameters:
        typeCode - type of object which property is change
        property - 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, see canRemoveTypeInstance(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 change
        property - 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 using canRemoveInstance(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 object
        property - 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