public class ModuleSecurity extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
enable |
protected ModulePermissions |
rootPerm |
Constructor and Description |
---|
ModuleSecurity(IModule<?> module,
String moduleTypeAlias,
boolean enable) |
Modifier and Type | Method and Description |
---|---|
void |
checkPermission(IPermission perm)
Checks if the current user has the given permission and throws
exception if it doesn't
|
void |
clearCurrentUser()
Clears the user associated to the current thread
|
boolean |
hasPermission(IPermission perm)
Checks if the current user has the given permission
|
void |
setCurrentUser(String userID)
Sets the user attempting to use this module in the current thread
|
protected final ModulePermissions rootPerm
protected boolean enable
public boolean hasPermission(IPermission perm)
perm
- public void checkPermission(IPermission perm) throws SecurityException
perm
- SecurityException
public void setCurrentUser(String userID)
userID
- public void clearCurrentUser()
Copyright © 2016 Sensia Software LLC. All rights reserved.