Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin Cookbook this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

How @RoleAllowed handle higer privilege roles internally

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
          In my project @RolesAllowed is used as @RolesAllowed({ "EMPLOYEE }) for methods.But those methods also can be used with higher privilege roles like ADMIN, HR. In an enum roles are declared as ---



It's a web project and sping core is used here.
What can be the possible ways these roles are applied internally for those methods?
Thanks
 
Saloon Keeper
Posts: 21478
144
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that this is more of a Spring question than Java in General.

I'm not sure what Spring is providing, but the JEE standard roles don't have "higher" and "lower" privileges. You either have a role or you don't, and if you have at least one of the roles permitted for the resource, you can access the resource, otherwise you cannot (logical "OR" relationship).

But I'll post this to the Spring forum where they can give you information more specific to Spring.
 
Abhra Kar
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Tim, please provide the link posted in spring community so I can follow up.
Regards,
Abhra
 
Tim Holloway
Saloon Keeper
Posts: 21478
144
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Abhra Kar wrote:Thanks a lot Tim, please provide the link posted in spring community so I can follow up.
Regards,
Abhra


I've already cross-linked it, so you don't need to do anything.
 
It will give me the powers of the gods. Not bad for a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!