|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectservices.SecurityService
class SecurityService
CoW specific security service.
Property Summary | |
---|---|
static Map |
conf
Get configuration |
Constructor Summary | |
SecurityService()
|
Method Summary | |
---|---|
boolean
|
anonAllowed(CowPermission requiredPerm)
Returns true if a required permission is implied by a configured permission assigned to the "anonymous" role. |
void
|
assignToDefaultRole(JsecUser jsecUser)
Assign a user to the default role |
boolean
|
checkPermission(def controllerName, def actions, def wikiId, def dir)
Check whether the current (anonymous or logged-in) user has permission for the given controller, actions, wiki and directory. |
boolean
|
checkServer()
Checks whether the user is in server mode. |
boolean
|
checkWorkstation()
Checks whether the user is in workstation mode. |
void
|
createDefaultRoles(String wikiId)
Create a few default roles and role permissions for a wiki, but do not add any specific users to the roles. |
void
|
deleteRolesAndPermissions(String wikiId)
Delete all permissions on a given wiki, and all roles that only have permissions on the given wiki. |
static JsecActionList
|
getActionList(def name)
Get a JsecActionList, null if none exists |
private JsecActionList
|
getActionList(def name, def actions)
Get a JsecActionList |
static JsecControllerName
|
getController(def name)
Get a JsecController, creating if it doesn't exist |
private JsecRole
|
getRole(def roleName)
Get a role, creating a new one if none exists |
private JsecRole
|
getRoleWithPermission(def roleName, def wikiId, def dir, def controller, def actions)
Get a role, creating a new one if none exists, and creating an associated CowPermission. |
private JsecRole
|
getRoleWithPermission(def roleName, def wikiId, def incDir, def exDir, def controller, def actions)
Get a role, creating a new one if none exists, and creating an associated CowPermission. |
String
|
getUsername()
Get the current username from jsecurity. |
boolean
|
isPermitted(CowPermission requiredPerm)
Returns true if a required permission matches any configured permissions. |
static def
|
isProtectedControllerName(def controllerOrName)
Check whether the given controller (or controller name) is one of the pre-configured contollers |
static def
|
isProtectedRole(def roleOrName)
Check whether the given role (or role name) is one of the three special "protected" roles, admin, default or anon. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Property Detail |
---|
static Map conf
Constructor Detail |
---|
SecurityService()
Method Detail |
---|
boolean anonAllowed(CowPermission requiredPerm)
void assignToDefaultRole(JsecUser jsecUser)
boolean checkPermission(def controllerName, def actions, def wikiId, def dir)
boolean checkServer()
true
if in server mode, otherwise false
.
boolean checkWorkstation()
true
if in workstaiton mode, otherwise false
.
void createDefaultRoles(String wikiId)
void deleteRolesAndPermissions(String wikiId)
public static JsecActionList getActionList(def name)
private JsecActionList getActionList(def name, def actions)
public static JsecControllerName getController(def name)
private JsecRole getRole(def roleName)
private JsecRole getRoleWithPermission(def roleName, def wikiId, def dir, def controller, def actions)
private JsecRole getRoleWithPermission(def roleName, def wikiId, def incDir, def exDir, def controller, def actions)
String getUsername()
boolean isPermitted(CowPermission requiredPerm)
public static def isProtectedControllerName(def controllerOrName)
public static def isProtectedRole(def roleOrName)
Groovy Documentation