• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use @RolesAllowed annotation for multiple roles.

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the correct way:

@RollesAllowed("ADMIN","CSR")

OR

@RollesAllowed("ADMIN, CSR")

OR

@RollesAllowed({"ADMIN","CSR"})
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@RollesAllowed({"ADMIN","CSR"}) should be used for multiple roles.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only three "l" in @RolesAllowed ;) (not @RollesAllowed)

If you understand how annotations work, you should be able to figure that yourself. Look at the definition in the API :

This annotation takes an array of String. So the proper use of this annotation should be, as Amandeep said, @RolesAllowed({"ADMIN","CSR"}).
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Amandeep and Christophe.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic