Groovy Documentation

realms
Class CowDbRealm

java.lang.Object
  realms.CowDbRealm

class CowDbRealm

Determines whether or not a user has permission to do something. CowDbRealm use plain database authentication and rights management, via a custom permission, gate.cow.CowPermission

Based on JsecDbRealm.groovy from the Grails JSecurity plugin


Property Summary
static def authTokenClass

The JSecurity authentication token supported by this realm.

def credentialMatcher

Matches an authToken against the database

 
Constructor Summary
CowDbRealm()

 
Method Summary
def authenticate(def authToken)

Authenticate a user in the CoW database realm.

def hasAllRoles(def principal, def roles)

Determines whether a user has all the particular role or not.

def hasRole(def principal, def roleName)

Determines whether a user has a particular role or not.

def isPermitted(def principal, def requiredPermission)

Does the user have the given permission directly associated with themselves?

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Property Detail

authTokenClass

static def authTokenClass
The JSecurity authentication token supported by this realm. It is often UsernamePasswordToken, in which authentication is performed via a given username and password.


credentialMatcher

def credentialMatcher
Matches an authToken against the database


 
Constructor Detail

CowDbRealm

CowDbRealm()


 
Method Detail

authenticate

public def authenticate(def authToken)
Authenticate a user in the CoW database realm.
param:
authToken an instance of authTokenClass
return:
a principal, if succesful


hasAllRoles

public def hasAllRoles(def principal, def roles)
Determines whether a user has all the particular role or not.
param:
principal the principal returned by the {{authenticate()}} method
param:
roles the Collection of the role names


hasRole

public def hasRole(def principal, def roleName)
Determines whether a user has a particular role or not.
param:
principal the principal returned by the {{authenticate()}} method
param:
roleName the String name of the role


isPermitted

public def isPermitted(def principal, def requiredPermission)
Does the user have the given permission directly associated with themselves?
param:
principal the principal returned by the {{authenticate()}} method
param:
requiredPermission the Permission that is required


 

Groovy Documentation