Class DefaultCMSPermissionCachedCRUDService

    • Constructor Detail

      • DefaultCMSPermissionCachedCRUDService

        public DefaultCMSPermissionCachedCRUDService()
    • Method Detail

      • getOrSetCachedTypePermission

        protected boolean getOrSetCachedTypePermission​(java.lang.String permissionName,
                                                       java.lang.String typeCode,
                                                       java.util.function.Function<java.lang.String,​java.lang.Boolean> permissionChecker)
        Returns type permission from the cache if it exists, calculates the permission and puts to the cache otherwise.
        Parameters:
        permissionName - permission name
        typeCode - type code
        permissionChecker - the Function to verify permission if it does not exist in the cache.
        Returns:
        true if current user has permission, false otherwise.
      • getOrSetCachedTypePermission

        protected boolean getOrSetCachedTypePermission​(java.lang.String permissionName,
                                                       ComposedTypeModel composedType,
                                                       java.util.function.Function<java.lang.String,​java.lang.Boolean> permissionChecker)
      • getOrSetCachedAttributePermission

        protected boolean getOrSetCachedAttributePermission​(java.lang.String permissionName,
                                                            java.lang.String typeCode,
                                                            java.lang.String qualifier,
                                                            java.util.function.BiFunction<java.lang.String,​java.lang.String,​java.lang.Boolean> permissionChecker)
        Returns attribute permission from the cache if it exists, calculates the permission and puts to the cache otherwise.
        Parameters:
        permissionName - permission name
        typeCode - type code
        qualifier - attribute qualifier
        permissionChecker - the BiFunction to verify permission if it does not exist in the cache.
        Returns:
        true if current user has permission, false otherwise.
      • getOrSetCachedAttributePermission

        protected boolean getOrSetCachedAttributePermission​(java.lang.String permissionName,
                                                            AttributeDescriptorModel attributeDescriptor,
                                                            java.util.function.BiFunction<java.lang.String,​java.lang.String,​java.lang.Boolean> permissionChecker)
      • addAttributePermissionToCache

        protected void addAttributePermissionToCache​(java.lang.String permissionName,
                                                     java.lang.String typeCode,
                                                     java.lang.String qualifier,
                                                     boolean hasPermission)
        Adds attribute permission to the cache.
        Parameters:
        permissionName - permission name
        typeCode - type code
        qualifier - attribute qualifier
        hasPermission - true if current user has permission, false otherwise.
      • addTypePermissionToCache

        protected void addTypePermissionToCache​(java.lang.String permissionName,
                                                java.lang.String typeCode,
                                                boolean hasPermission)
        Adds type permission to the cache.
        Parameters:
        permissionName - permission name
        typeCode - type code
        hasPermission - true if current user has permission, false otherwise.
      • getUniqueAttributeKey

        protected java.lang.String getUniqueAttributeKey​(java.lang.String permissionName,
                                                         java.lang.String typeCode,
                                                         java.lang.String qualifier)
        Generates a unique name to store attribute permission in the cache
        Parameters:
        permissionName - permission name
        typeCode - type code
        qualifier - attribute qualifier
        Returns:
        the unique name for an attribute permission
      • getUniqueTypeKey

        protected java.lang.String getUniqueTypeKey​(java.lang.String permissionName,
                                                    java.lang.String typeCode)
      • setSessionCachedContextProvider

        public void setSessionCachedContextProvider​(SessionCachedContextProvider sessionCachedContextProvider)
      • setPermissionCRUDService

        public void setPermissionCRUDService​(PermissionCRUDService permissionCRUDService)
      • setPermissionEnablerService

        public void setPermissionEnablerService​(PermissionEnablerService permissionEnablerService)