Class DesignerPermissionUtil


  • public class DesignerPermissionUtil
    extends java.lang.Object
    A utility class that assists in verifying permissions given the user and global project props or required roles for save,publish,view,export,copy, or delete on a project Note: every permission utility method returns true if the global props are null because the project might not have any global props, hence granting permission
    • Method Detail

      • hasPermission

        public static boolean hasPermission​(@Nullable
                                            User user,
                                            @Nullable
                                            java.util.Collection<java.lang.String> requiredRoles)
      • hasPermission

        public static boolean hasPermission​(@Nonnull
                                            java.util.Collection<java.lang.String> userRoles,
                                            @Nonnull
                                            java.util.Collection<java.lang.String> requiredRoles)
      • canViewProject

        public static boolean canViewProject​(@Nullable
                                             GlobalProps props,
                                             @Nullable
                                             User user)
      • canViewProject

        public static boolean canViewProject​(@Nullable
                                             java.util.List<java.lang.String> viewRoles,
                                             @Nullable
                                             User user)
      • canCreateProject

        public static boolean canCreateProject​(@Nullable
                                               java.util.List<java.lang.String> gatewayRoles,
                                               @Nullable
                                               User user)
      • canSaveProject

        public static boolean canSaveProject​(@Nullable
                                             GlobalProps props,
                                             @Nullable
                                             User user)
      • canEditProtectedResources

        public static boolean canEditProtectedResources​(@Nullable
                                                        GlobalProps props,
                                                        @Nullable
                                                        User user)
      • canDeleteProject

        public static boolean canDeleteProject​(@Nullable
                                               GlobalProps props,
                                               @Nullable
                                               User user)
      • canDeleteProject

        public static boolean canDeleteProject​(@Nullable
                                               GlobalProps props,
                                               @Nullable
                                               java.util.Collection<java.lang.String> userRoles)