Package step.controller.multitenancy
Class MultitenancyManager
- java.lang.Object
-
- step.controller.multitenancy.MultitenancyManager
-
public class MultitenancyManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE_PROJECT
static java.lang.String
GLOBAL_TENANT_NAME
static java.lang.String
NO_TENANT_NAME
static java.lang.String
PROJECT_ACCESS_ALL_RIGHT
static java.lang.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(java.lang.String projectId, java.lang.String userid, java.lang.String roleInProject)
java.util.List<step.controller.multitenancy.Tenant>
getAllAvailableTenants()
step.controller.multitenancy.Tenant
getCurrentTenant(step.core.AbstractContext session)
protected java.util.List<Project>
getGlobalProjects()
step.core.objectenricher.ObjectHook
getObjectHook()
protected java.lang.String
getOQLFilterForTenant(step.controller.multitenancy.TenantContext tenantContext)
java.util.List<ProjectMembership>
getProjectMembers(java.lang.String projectId)
protected ProjectMembership
getProjectMembership(java.lang.String projectId, java.lang.String userid)
protected ProjectMembership
getProjectMembership(java.util.List<ProjectMembership> members, java.lang.String userid)
java.util.List<step.controller.multitenancy.Tenant>
getTenantsInSession(step.framework.server.Session<step.core.access.User> session)
java.util.List<step.controller.multitenancy.Tenant>
getTenantsOfUser(java.lang.String userId)
java.util.function.BiConsumer<java.lang.Object,step.core.imports.ImportContext>
importHookFactory()
void
removeMemberFromProject(java.lang.String id, java.lang.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, java.lang.String tenantName)
boolean
viewAllProjects(step.core.access.User user)
-
-
-
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
-
NO_TENANT_NAME
public static final java.lang.String NO_TENANT_NAME
- See Also:
- Constant Field Values
-
ATTRIBUTE_PROJECT
public static final java.lang.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 java.util.List<step.controller.multitenancy.Tenant> getTenantsInSession(step.framework.server.Session<step.core.access.User> session)
-
getTenantsOfUser
public java.util.List<step.controller.multitenancy.Tenant> getTenantsOfUser(java.lang.String userId)
-
getAllAvailableTenants
public java.util.List<step.controller.multitenancy.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.lang.Exception
- Throws:
java.lang.Exception
-
getProjectMembership
protected ProjectMembership getProjectMembership(java.lang.String projectId, java.lang.String userid)
-
getProjectMembership
protected ProjectMembership getProjectMembership(java.util.List<ProjectMembership> members, java.lang.String userid)
-
getCurrentTenant
public step.controller.multitenancy.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)
-
-