|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Object org.grails.plugin.platform.security.SecurityImpl
class SecurityImpl
Bean for registering and accessing security information A security-provider plugin must be installed
Property Summary | |
---|---|
org.springframework.context.ApplicationContext |
applicationContext
|
java.lang.Object |
grailsSecurityBridge
|
java.lang.Object |
injectedMethods
|
java.lang.Object |
log
|
Constructor Summary | |
SecurityImpl()
|
Method Summary | |
---|---|
java.util.Map
|
createLink(java.lang.String action)
Create a link to the specified security action |
SecurityBridge
|
getSecurityBridge(boolean throwIfNone = false)
|
java.lang.String
|
getUserIdentity()
Get user id string i.e. |
java.lang.Object
|
getUserInfo()
Get user info object i.e. email address, other stuff defined by the security implementation |
boolean
|
hasProvider()
|
java.lang.Object
|
ifUserHasRole(java.lang.Object role, groovy.lang.Closure code)
|
java.lang.Object
|
ifUserIsAllowed(java.lang.Object object, java.lang.Object action, groovy.lang.Closure code)
Can the current user access this object to perform the named action? |
java.lang.Object
|
requirePermission(java.lang.Object object, java.lang.Object action, groovy.lang.Closure code)
Run the closure if userIsAllowed returns true for the object and action otherwise throw exception |
void
|
setApplicationContext(org.springframework.context.ApplicationContext context)
|
boolean
|
userExists(java.lang.Object identity)
Determine whether a user with the given id already exists or not |
boolean
|
userHasAllRoles(java.lang.Object roleOrRoles)
Test if the user has all the listed roles |
boolean
|
userHasAnyRole(java.lang.Object roleOrRoles)
Test if the user has any of the listed roles |
boolean
|
userIsAllowed(java.lang.Object object, java.lang.Object action)
Can the current user access this object to perform the named action? |
java.lang.Object
|
withUser(java.lang.Object identity, groovy.lang.Closure code)
Execute the closure pretending to be the user id specified |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Property Detail |
---|
org.springframework.context.ApplicationContext applicationContext
java.lang.Object grailsSecurityBridge
java.lang.Object injectedMethods
final java.lang.Object log
Constructor Detail |
---|
SecurityImpl()
Method Detail |
---|
java.util.Map createLink(java.lang.String action)
action
- One of "login", "logout", "signup"
SecurityBridge getSecurityBridge(boolean throwIfNone = false)
java.lang.String getUserIdentity()
java.lang.Object getUserInfo()
boolean hasProvider()
java.lang.Object ifUserHasRole(java.lang.Object role, groovy.lang.Closure code)
java.lang.Object ifUserIsAllowed(java.lang.Object object, java.lang.Object action, groovy.lang.Closure code)
object
- The object, typically domain but we don't care whataction
- Some application-defined action string i.e. "view" or "edit"
java.lang.Object requirePermission(java.lang.Object object, java.lang.Object action, groovy.lang.Closure code)
void setApplicationContext(org.springframework.context.ApplicationContext context)
boolean userExists(java.lang.Object identity)
boolean userHasAllRoles(java.lang.Object roleOrRoles)
roleOrRoles
- A list of roles or a single role
boolean userHasAnyRole(java.lang.Object roleOrRoles)
roleOrRoles
- A list of roles or a single role
boolean userIsAllowed(java.lang.Object object, java.lang.Object action)
object
- The object, typically domain but we don't care whataction
- Some application-defined action string i.e. "view" or "edit"
java.lang.Object withUser(java.lang.Object identity, groovy.lang.Closure code)
Groovy Documentation