Class DefaultResourcePolicyGroupResolver

java.lang.Object
io.jmix.securityflowui.model.DefaultResourcePolicyGroupResolver

@Component("sec_DefaultResourcePolicyGroupResolver") public class DefaultResourcePolicyGroupResolver extends Object
Class is used for getting default policy group for the ResourcePolicy instance.
  • Field Details

  • Constructor Details

    • DefaultResourcePolicyGroupResolver

      public DefaultResourcePolicyGroupResolver(ViewRegistry viewRegistry, MenuConfig menuConfig, Metadata metadata)
  • Method Details

    • resolvePolicyGroup

      @Nullable public String resolvePolicyGroup(ResourcePolicy resourcePolicy)
      Methods evaluates default policy group for a given ResourcePolicy.
      Parameters:
      resourcePolicy - a ResourcePolicy
      Returns:
      a group policy or null if the group cannot be resolved
      See Also:
    • resolvePolicyGroup

      @Nullable public String resolvePolicyGroup(String resourcePolicyType, String resource)
      Methods evaluates security policy group for a given resource of the ResourcePolicy.

      For entity:

      • the entity name is returned

      For entity attributes:

      • a policy group for the attribute's entity is returned

      For view:

      • returns a policy group of the related entity (for standard detail and list views). If the view implements the LookupView or DetailView interfaces then a generic type is taken and assuming that a generic type points to the entity class the policy group of the entity is returned

      For menu:

      • policy group for the related screen is returned
      Parameters:
      resourcePolicyType - a ResourcePolicyType, i.e. view, entity, menu, etc.
      resource - a resource (viewId, entity name, etc.)
      Returns:
      a policy group or null if policy group cannot be resolved
      See Also:
    • resolvePolicyGroupForEntityAttributePolicy

      @Nullable protected String resolvePolicyGroupForEntityAttributePolicy(String resource)
    • resolvePolicyGroupForEntityPolicy

      @Nullable protected String resolvePolicyGroupForEntityPolicy(String entityName)
    • resolvePolicyGroupForScreenPolicy

      @Nullable protected String resolvePolicyGroupForScreenPolicy(String viewId)
    • resolvePolicyGroupByScreenControllerGenericType

      @Nullable protected String resolvePolicyGroupByScreenControllerGenericType(Class<? extends View<?>> controllerClass)
    • resolvePolicyGroupForMenuPolicy

      @Nullable protected String resolvePolicyGroupForMenuPolicy(String menuId)