• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jboss drools tutorial in eclipse-ganymede

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to add permissions to my eclipse seam project using jboss rules. When I created the project a security.drl file was added to it. I am trying to grant permissions to certain logged in user groups. In a typical scenario, a user would log into the system and a User object would be added to the session when the authenticate method is called. From this point, I need a way to deny login access to a certain user group, say bankers. I also need to allow Administrators to add users to the system. I am having trouble finding documentation to explain how the syntax should work for this scenario. How would the security.drl file know about the user object in the session or am I viewing this wrong? Second, is PermissionCheck and Role something that my object provides or is it something internal to Drools? Also, can someone point me in the direction of documentation and example code?

I was thinking it would look like this:

rule "DenyAccessToBankers"
when
c: PermissionCheck(name == "Login")
Role(name == "Bankers")
then
c.revoke();
end

rule "AllowUserAccessToAdministrators"
when
c: PermissionCheck(name == "User", action in ("edituser","deleteuser","adduser"))
Role(name == "Administrator")
then
c.grant();
end
reply
    Bookmark Topic Watch Topic
  • New Topic