Class DefaultPermissionEnablerService

    • Field Detail

      • DEFAULT_EXPIRATION_TIME

        protected static final java.lang.Long DEFAULT_EXPIRATION_TIME
    • Constructor Detail

      • DefaultPermissionEnablerService

        public DefaultPermissionEnablerService()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • initializeCompiledTypeConfigurations

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> initializeCompiledTypeConfigurations​(java.lang.Long expirationTime)
      • initializeCompiledAttributeConfigurations

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> initializeCompiledAttributeConfigurations​(java.lang.Long expirationTime)
      • buildTypeConfigurations

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> buildTypeConfigurations()
        Initializes the service with Configuration containing type and attribute level permissions for each type.
      • buildAttributeConfigurationsForAllTypes

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> buildAttributeConfigurationsForAllTypes()
        Initializes the service with Configuration containing type and attribute level permissions for each type.
      • getAllSubTypesPermissionConfigs

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAllSubTypesPermissionConfigs​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> configurations)
        Returns configurations for all subtypes for each type in the povided configurations list.
        Parameters:
        configurations - The list of type configurations.
        Returns:
        The list of all subtype configurations for each type.
      • getAllTypePermissionConfigs

        protected java.util.List<TypePermissionConfigs> getAllTypePermissionConfigs​(java.util.List<AttributePermissionForType> permissionConfigs)
        Returns a list of type permission configs where each config is a collection of attribute permission configs for each type and its super types.
        Parameters:
        permissionConfigs - List of attribute permission configs for type
        Returns:
        The list of type permission configs
      • buildAllIncludedAttributes

        protected java.util.List<TypePermissionConfigs> buildAllIncludedAttributes​(java.util.List<TypePermissionConfigs> configurations)
        Returns a list of type permission configs by building the Include attribute that contains the list of attributes to be included for each type during permission checking.
        Parameters:
        configurations - The list of type permission configs
        Returns:
        The list of type permission configs with include attributes populated.
      • buildIncludedAttributesForType

        protected void buildIncludedAttributesForType​(TypePermissionConfigs typeConfig)
        Builds the Include attribute that contains the list of attributes to be included for the type during permission checking.
        Parameters:
        typeConfig - The type permission configuration
      • parseParam

        protected java.util.List<java.lang.String> parseParam​(java.lang.String params)
        Parses the given parameter that contains a comma separated attributes and returns a list.
      • getPermissionConfigsByTypeCodes

        protected java.util.List<AttributePermissionForType> getPermissionConfigsByTypeCodes​(java.util.List<java.lang.String> typeCodes)
        Returns a list of attribute permission types available for each provided type code.
      • getPermissionConfigByTypeCode

        protected java.util.Optional<AttributePermissionForType> getPermissionConfigByTypeCode​(java.lang.String typeCode)
        Returns a list of attribute permission types available for a given type code.
      • isTypeVerifiable

        public boolean isTypeVerifiable​(java.lang.String typeCode)
        Description copied from interface: PermissionEnablerService
        Method that tests whether the ComposedTypeModel for the given typeCode can be verified while permission checking.
        Specified by:
        isTypeVerifiable in interface PermissionEnablerService
        Parameters:
        typeCode - The type code to be verified.
        Returns:
        TRUE if the permission checking is enabled for the given type, FALSE otherwise.
      • isAttributeVerifiable

        public boolean isAttributeVerifiable​(java.lang.String typeCode,
                                             java.lang.String attribute)
        Description copied from interface: PermissionEnablerService
        Method that tests whether the provided attribute part of the ComposedTypeModel for the given typeCode can be verified while permission checking. This method also checks if the attribute is in all the super types of the given type.
        Specified by:
        isAttributeVerifiable in interface PermissionEnablerService
        Parameters:
        typeCode - The type code to of the attribute to be verified.
        attribute - The attribute to be verified.
        Returns:
        TRUE if the permission checking is enabled for the given attribute within a type, FALSE otherwise.
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • getCheckingAllTypes

        protected boolean getCheckingAllTypes()
      • setCheckingAllTypes

        public void setCheckingAllTypes​(boolean checkingAllTypes)
      • getCheckingAllAttributes

        protected boolean getCheckingAllAttributes()
      • setCheckingAllAttributes

        public void setCheckingAllAttributes​(boolean checkingAllAttributes)