Class MultitenancyManager


  • public class MultitenancyManager
    extends java.lang.Object
    • Field Detail

      • PROJECT_ACCESS_ALL_RIGHT

        public static final java.lang.String PROJECT_ACCESS_ALL_RIGHT
        See Also:
        Constant Field Values
      • PROJECT_VIEW_ALL_RIGHT

        public static final java.lang.String PROJECT_VIEW_ALL_RIGHT
        See Also:
        Constant Field Values
      • GLOBAL_TENANT_NAME

        public static final java.lang.String GLOBAL_TENANT_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • MultitenancyManager

        public MultitenancyManager​(step.core.access.UserAccessor userAccessor,
                                   ProjectAccessor projectAccessor,
                                   step.core.access.RoleProvider roleProvider)
    • Method Detail

      • accessAllProjects

        public boolean accessAllProjects​(step.core.access.User user)
      • viewAllProjects

        public boolean viewAllProjects​(step.core.access.User user)
      • checkAllProjectRights

        public boolean checkAllProjectRights​(step.core.access.User user,
                                             java.lang.String right)
      • getTenantsInSession

        public java.util.List<Tenant> getTenantsInSession​(step.framework.server.Session<step.core.access.User> session)
      • getTenantsOfUser

        public java.util.List<Tenant> getTenantsOfUser​(java.lang.String userId)
      • getAllAvailableTenants

        public java.util.List<Tenant> getAllAvailableTenants()
      • selectDefaultTenantIfNoTenantIsSelected

        public void selectDefaultTenantIfNoTenantIsSelected​(@NotNull
                                                            @NotNull step.framework.server.Session<step.core.access.User> session)
      • selectTenant

        public void selectTenant​(@NotNull
                                 @NotNull step.framework.server.Session<step.core.access.User> session,
                                 java.lang.String tenantName)
                          throws java.security.AccessControlException,
                                 java.lang.Exception
        Throws:
        java.security.AccessControlException
        java.lang.Exception
      • getProjectMembership

        protected ProjectMembership getProjectMembership​(java.lang.String projectId,
                                                         java.lang.String userid)
      • getCurrentTenant

        public Tenant getCurrentTenant​(step.core.AbstractContext session)
      • getObjectHook

        public step.core.objectenricher.ObjectHook getObjectHook()
      • importHookFactory

        public java.util.function.BiConsumer<java.lang.Object,​step.core.imports.ImportContext> importHookFactory()
      • getProjectMembers

        public java.util.List<ProjectMembership> getProjectMembers​(java.lang.String projectId)
      • addMemberToProject

        public void addMemberToProject​(java.lang.String projectId,
                                       java.lang.String userid,
                                       java.lang.String roleInProject)
      • getOQLFilterForTenant

        protected java.lang.String getOQLFilterForTenant​(step.controller.multitenancy.TenantContext tenantContext)
      • getGlobalProjects

        protected java.util.List<Project> getGlobalProjects()
      • removeMemberFromProject

        public void removeMemberFromProject​(java.lang.String id,
                                            java.lang.String userid)