Hi all, I had a problem displaying the role description stored in the
security.xml. To display the description of roles, I have to write some
lines of code and I spent more than one hour to do this:
Permission perm1=null;
Collection perm = domainAuth.listPermissions(User.get());
Collection roles = new HashSet();
Iterator it = perm.iterator();
while (it.hasNext()){
perm1 = (Permission)it.next();
Role role = (Role) RoleFactory.getInstance().findByKey(perm1.getRoleId());
roles.add(role);
}
I think that it will be simple to do a method in the class "User" that
returns the Set of roles that are associated to the current User.
--
View this message in context: http://www.nabble.com/-AUTH--Get-list-of-roles-hardly-tp20120376s17546p20120376.html
Sent from the SmartWeb Users mailing list archive at Nabble.com.
|