Class UiAccessChecker

java.lang.Object
io.jmix.flowui.sys.UiAccessChecker

@Component("flowui_UiAccessChecker") public class UiAccessChecker extends Object
Class checks UI access permission.
  • Field Details

    • accessAnnotationChecker

      protected com.vaadin.flow.server.auth.AccessAnnotationChecker accessAnnotationChecker
    • accessManager

      protected AccessManager accessManager
    • viewRegistry

      protected ViewRegistry viewRegistry
  • Constructor Details

    • UiAccessChecker

      public UiAccessChecker(@Nullable com.vaadin.flow.server.auth.AccessAnnotationChecker accessAnnotationChecker, AccessManager accessManager, ViewRegistry viewRegistry)
  • Method Details

    • isMenuPermitted

      public boolean isMenuPermitted(MenuItem menuItem)
      Firstly AccessAnnotationChecker checks annotation constraints, if menu item is not permitted then AccessManager checks granted permissions.
      Parameters:
      menuItem - menu item to check
      Returns:
      true if menu item is permitted
    • isViewPermitted

      public boolean isViewPermitted(Class<?> target)
      Firstly AccessAnnotationChecker checks annotation constraints, if view is not permitted then AccessManager checks granted permissions.
      Parameters:
      target - class to check
      Returns:
      true if view is permitted
    • checkViewPermitted

      public void checkViewPermitted(Class<?> target)
      Checks for access to the view. Throws exception if no access.
      Parameters:
      target - class to check
      Throws:
      AccessDeniedException - if the user does not have access to the view
    • getControllerClass

      protected Class<? extends View<?>> getControllerClass(MenuItem menuItem)
    • isSupportedView

      protected boolean isSupportedView(Class<?> targetView)
    • isViewHasSecurityPermission

      protected boolean isViewHasSecurityPermission(Class<?> target)
    • isMenuItemHasSecurityPermission

      protected boolean isMenuItemHasSecurityPermission(MenuItem menuItem)