Interface CMSPermissionChecker

  • All Known Implementing Classes:
    DefaultCMSPermissionChecker

    public interface CMSPermissionChecker
    Helper service to check permissions
    • Method Detail

      • hasPermissionForContainedType

        boolean hasPermissionForContainedType​(AttributeDescriptorModel attributeDescriptorModel,
                                              java.lang.String permissionName)
        Type permission checking to see if the current principal has permissions to perform the specified operation (e.g. read, change, create or remove) on the type of an attribute or not.
        • When the attribute is of type ComposedTypeModel, this method verifies that the type specified in the ComposedTypeModel is manageable by the current user.
        • When the attribute is of type AtomicTypeModel, no additional type checking needs to be done. This will always return TRUE.

        Possible scenarios are listed in the table below:

        Sample Attribute Attribute Expected Result
        String name Atomic type always TRUE
        Media media Composed type TRUE when user has permission for Media type
        List<MediaModel> media Collection of Composed type TRUE when user has permission for Media type
        Map<String, MediaModel> media Localized Composed type TRUE when user has permission for Media type
        Map<String, List<MediaModel>> media Localized Collection of Composed type TRUE when user has permission for Media type
        Parameters:
        attribute - - The descriptor that specifies the attribute whose read permission to check.
        permissionName - - The name of the permission to be checked; valid values defined in PermissionsConstants
        Returns:
        true if the current principal has been granted change permission on the type contained in the non-primitive attribute or the attribute is of type AtomicTypeModel; false otherwise.