-
1. Re: Granting based on user permission and roles
shane.bryzak Dec 24, 2009 8:41 AM (in response to damonchong)You have two different permission checks, one (the persistent one) is for a target of literal string 'compoundBrowser', the other one (the rule-based one) is for a target of an instance of the CompoundBrowser class. You probably want to modify the rule to read as follows to bring them in line:
rule AdminCanViewEditAnything when check: PermissionCheck(target == 'compoundBrowser') Role(name == "Admin") then check.grant(); end
-
2. Re: Granting based on user permission and roles
damonchong Dec 24, 2009 6:35 PM (in response to damonchong)Thanks for the advice Shane, but unfortunately I am still facing the same problem. Guess I have to try harder on this one. Anyway, merry X'mas! ;-)
-
3. Re: Granting based on user permission and roles
damonchong Dec 30, 2009 3:01 AM (in response to damonchong)Hi Shane,
Happy new year to you. I figure out why it is not working. Apparently the package name for the different drl files must be the same. My default rule file, security.drl was using package com.abc.defaultPermissions; while the npc.drl was using com.abc.npcPermissions. I could not find any mention in the Seam documentation that this needs to be so. I guess it might be in the Drools documentation. Oh well, hope this helps anyone facing similar problems. Thanks alot!
Shane Bryzak wrote on Dec 24, 2009 08:41:
You have two different permission checks, one (the persistent one) is for a target of literal string 'compoundBrowser', the other one (the rule-based one) is for a target of an instance of the CompoundBrowser class. You probably want to modify the rule to read as follows to bring them in line:rule AdminCanViewEditAnything when check: PermissionCheck(target == 'compoundBrowser') Role(name == "Admin") then check.grant(); end
Click HELP for text formatting instructions. Then edit this text and check the preview.