java ee - j2ee - User with multiple security roles -


i developing java servlets webapp use container based security authenticate users in. question can user mapped more 1 security role ?

for example in case-:

a user can a

  • teacher
  • co-ordinator ( can teacher)
  • admin (who can teacher)

now admin have privileges access more functionality teacher. how possible container based security container tomcat ?

i not using framework spring security or apache shiro.

in short - user or better group - can mapped many security roles. easiest define security roles in web.xml, this:

  <security-role>     <role-name>teacher</role-name>   </security-role>   .... 

and use in <security-constraint> specify role has access given set of resources.

finally need map these roles users, server specific.

you can find basic information regarding security roles , constraints in websphere application server v7.0 security guide in securing web application chapter.

instead of using tomcat, i'd suggest using websphere liberty , eclipse websphere developer tools. has nice graphical interface editing web.xml, able define these roles , constraints. has server configuration editor can configure basic registry users , groups , create mapping between roles , users.

if need more info how set in liberty can check websphere liberty profile guide developers


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -