Package step.controller.multitenancy
Class MultitenancyManager
- java.lang.Object
-
- step.controller.multitenancy.MultitenancyManager
-
public class MultitenancyManager extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTRIBUTE_PROJECT
static String
GLOBAL_TENANT_NAME
static String
NO_TENANT_NAME
static String
PROJECT_ACCESS_ALL_RIGHT
static String
PROJECT_VIEW_ALL_RIGHT
-
Constructor Summary
Constructors Constructor Description MultitenancyManager(step.core.access.UserAccessor userAccessor, ProjectAccessor projectAccessor, step.framework.server.access.AuthorizationManager authorizationManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accessAllProjects(step.core.access.User user)
void
addMemberToProject(String projectId, String userid, String roleInProject)
List<Tenant>
getAllAvailableTenants()
Tenant
getCurrentTenant(step.core.AbstractContext session)
protected List<Project>
getGlobalProjects()
step.core.objectenricher.ObjectHook
getObjectHook()
protected String
getOQLFilterForTenant(step.controller.multitenancy.TenantContext tenantContext)
List<ProjectMembership>
getProjectMembers(String projectId)
protected ProjectMembership
getProjectMembership(String projectId, String userid)
protected ProjectMembership
getProjectMembership(List<ProjectMembership> members, String userid)
List<Tenant>
getTenantsInSession(step.framework.server.Session<step.core.access.User> session)
List<Tenant>
getTenantsOfUser(String userId)
BiConsumer<Object,step.core.imports.ImportContext>
importHookFactory()
void
removeMemberFromProject(String id, String userid)
void
selectDefaultTenantIfNoTenantIsSelected(@NotNull step.framework.server.Session<step.core.access.User> session)
void
selectTenant(@NotNull step.framework.server.Session<step.core.access.User> session, String tenantName)
boolean
viewAllProjects(step.core.access.User user)
-
-
-
Field Detail
-
PROJECT_ACCESS_ALL_RIGHT
public static final String PROJECT_ACCESS_ALL_RIGHT
- See Also:
- Constant Field Values
-
PROJECT_VIEW_ALL_RIGHT
public static final String PROJECT_VIEW_ALL_RIGHT
- See Also:
- Constant Field Values
-
GLOBAL_TENANT_NAME
public static final String GLOBAL_TENANT_NAME
- See Also:
- Constant Field Values
-
NO_TENANT_NAME
public static final String NO_TENANT_NAME
- See Also:
- Constant Field Values
-
ATTRIBUTE_PROJECT
public static final String ATTRIBUTE_PROJECT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultitenancyManager
public MultitenancyManager(step.core.access.UserAccessor userAccessor, ProjectAccessor projectAccessor, step.framework.server.access.AuthorizationManager authorizationManager)
-
-
Method Detail
-
accessAllProjects
public boolean accessAllProjects(step.core.access.User user)
-
viewAllProjects
public boolean viewAllProjects(step.core.access.User user)
-
getTenantsInSession
public List<Tenant> getTenantsInSession(step.framework.server.Session<step.core.access.User> session)
-
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, String tenantName) throws Exception
- Throws:
Exception
-
getProjectMembership
protected ProjectMembership getProjectMembership(String projectId, String userid)
-
getProjectMembership
protected ProjectMembership getProjectMembership(List<ProjectMembership> members, String userid)
-
getCurrentTenant
public Tenant getCurrentTenant(step.core.AbstractContext session)
-
getObjectHook
public step.core.objectenricher.ObjectHook getObjectHook()
-
importHookFactory
public BiConsumer<Object,step.core.imports.ImportContext> importHookFactory()
-
getProjectMembers
public List<ProjectMembership> getProjectMembers(String projectId)
-
addMemberToProject
public void addMemberToProject(String projectId, String userid, String roleInProject)
-
getOQLFilterForTenant
protected String getOQLFilterForTenant(step.controller.multitenancy.TenantContext tenantContext)
-
-