my question is: (How?) can I store my "authority" for my user in the user class in Grails with the Spring Security Plugin?
I've given the following SQL structure:
User table:
...
varchar(255): username
...
int(2) rank: (refers to Rank table)
Rank table:
int(11): id
varchar(25): rank_name
Can I configure my domain classes, to work with that structure instead of the typical "User, Authority, UserAuthority many to many" schema?
The rank (id) is hierarchial, that means a user with the rank 4 got all "authorities" from a user with rank 3 etc.
EDIT: I simply replaced in the User Domain, the getAuthorities method with the following:
Set<Permission> getAuthorities() {
Authority.findAllById(this.rank)
// instead of: UserAuthority.findAllByUser(this)*.permission
}