Groovy Documentation

org.devnull.security.service
[Groovy] Interface SecurityService


interface SecurityService

Method Summary
User addRoleToUser(java.lang.Integer roleId, java.lang.Integer userId)

java.lang.Long countUsers()

Count all of the users in the system

User createNewUser(User user, java.util.List roles)

Create a new user with the given roles

void deleteUser(java.lang.Integer userId)

Delete the user from the system

User findByUserName(java.lang.String userName)

Find a user with the matching username

Role findRoleByName(java.lang.String name)

Lookup an existing role by name

User getCurrentUser()

Locates the current logged in user.

java.util.List listRoles()

Find all of the roles in the system.

java.util.List listUsers()

Find all users in the system.

User removeRoleFromUser(java.lang.Integer roleId, java.lang.Integer userId)

Remove the given role from the given user's role collection.

User updateCurrentUser(java.lang.Boolean reAuthenticate)

Save any changes to the authenticated user and optionally re-authenticate

 

Method Detail

addRoleToUser

User addRoleToUser(java.lang.Integer roleId, java.lang.Integer userId)


countUsers

java.lang.Long countUsers()
Count all of the users in the system


createNewUser

User createNewUser(User user, java.util.List roles)
Create a new user with the given roles
Parameters:
user - transient user
roles - starting roles for the user
Returns:
persisted version of the user


deleteUser

void deleteUser(java.lang.Integer userId)
Delete the user from the system


findByUserName

User findByUserName(java.lang.String userName)
Find a user with the matching username
Parameters:
userName
Returns:
persisted version of the user


findRoleByName

Role findRoleByName(java.lang.String name)
Lookup an existing role by name


getCurrentUser

User getCurrentUser()
Locates the current logged in user.
Returns:


listRoles

java.util.List listRoles()
Find all of the roles in the system.


listUsers

java.util.List listUsers()
Find all users in the system.


removeRoleFromUser

User removeRoleFromUser(java.lang.Integer roleId, java.lang.Integer userId)
Remove the given role from the given user's role collection.


updateCurrentUser

User updateCurrentUser(java.lang.Boolean reAuthenticate)
Save any changes to the authenticated user and optionally re-authenticate
Parameters:
reAuthenticate - if true, user's security context will be re-authenticated


 

Groovy Documentation