Package com.illumon.iris.controller
Class IrisUserContext
java.lang.Object
com.illumon.iris.controller.IrisUserContext
- All Implemented Interfaces:
IrisGroupProvider
public class IrisUserContext extends Object implements IrisGroupProvider
A super simple dummy implementation of a user context, where you just assert what the user is, and then
there are some hardcoded rules for testing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.permissions.IrisGroupProvider
IrisGroupProvider.UserType
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.permissions.IrisGroupProvider
FULL_ACCESS_GROUP, IRIS_ACLEDITORS, IRIS_QUERYMANAGERS, IRIS_SCHEMAMANAGERS, IRIS_SUPERUSERS, NON_INTERACTIVE_GROUP, QUERY_VIEW_ONLY_GROUP
-
Constructor Summary
Constructors Constructor Description IrisUserContext(com.fishlib.auth.UserContext userContext, IrisGroupProvider wrappedProvider)
-
Method Summary
Modifier and Type Method Description void
addRefreshListener(com.fishlib.base.Procedure.Nullary listener)
String[]
getAllGroups()
String[]
getAllUsers()
String[]
getGroupsForUser()
String[]
getGroupsForUser(com.fishlib.auth.UserContext userContext)
com.fishlib.auth.UserContext
getUserContext()
String[]
getUsersForGroup(String group)
IrisGroupProvider.UserType
getUserType()
IrisGroupProvider.UserType
getUserType(com.fishlib.auth.UserContext userContext)
boolean
isAclEditor()
boolean
isAclEditor(com.fishlib.auth.UserContext userContext)
boolean
isMember(com.fishlib.auth.UserContext userContext, String owner, String[] groups)
boolean
isMember(String owner, String[] groups)
boolean
isQueryManager()
boolean
isQueryManager(com.fishlib.auth.UserContext userContext)
boolean
isSchemaManager()
boolean
isSchemaManager(com.fishlib.auth.UserContext userContext)
boolean
isSuperUser()
boolean
isSuperUser(com.fishlib.auth.UserContext userContext)
void
refreshGroups()
void
removeRefreshListener(com.fishlib.base.Procedure.Nullary listener)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.permissions.IrisGroupProvider
getRunAsUser, getRunAsUserMap
-
Constructor Details
-
IrisUserContext
public IrisUserContext(@NotNull com.fishlib.auth.UserContext userContext, @NotNull IrisGroupProvider wrappedProvider)
-
-
Method Details
-
refreshGroups
public void refreshGroups() -
getUserContext
@NotNull public com.fishlib.auth.UserContext getUserContext() -
isSuperUser
public boolean isSuperUser() -
isAclEditor
public boolean isAclEditor() -
isSchemaManager
public boolean isSchemaManager() -
isQueryManager
public boolean isQueryManager() -
getUserType
-
isMember
-
isMember
public final boolean isMember(com.fishlib.auth.UserContext userContext, String owner, String[] groups)- Specified by:
isMember
in interfaceIrisGroupProvider
-
getGroupsForUser
-
getGroupsForUser
- Specified by:
getGroupsForUser
in interfaceIrisGroupProvider
-
getUsersForGroup
- Specified by:
getUsersForGroup
in interfaceIrisGroupProvider
-
isSuperUser
public boolean isSuperUser(com.fishlib.auth.UserContext userContext)- Specified by:
isSuperUser
in interfaceIrisGroupProvider
-
isAclEditor
public boolean isAclEditor(com.fishlib.auth.UserContext userContext)- Specified by:
isAclEditor
in interfaceIrisGroupProvider
-
isSchemaManager
public boolean isSchemaManager(com.fishlib.auth.UserContext userContext)- Specified by:
isSchemaManager
in interfaceIrisGroupProvider
-
isQueryManager
public boolean isQueryManager(com.fishlib.auth.UserContext userContext)- Specified by:
isQueryManager
in interfaceIrisGroupProvider
-
getAllGroups
- Specified by:
getAllGroups
in interfaceIrisGroupProvider
-
getAllUsers
- Specified by:
getAllUsers
in interfaceIrisGroupProvider
-
getUserType
- Specified by:
getUserType
in interfaceIrisGroupProvider
-
addRefreshListener
public void addRefreshListener(com.fishlib.base.Procedure.Nullary listener) -
removeRefreshListener
public void removeRefreshListener(com.fishlib.base.Procedure.Nullary listener)
-