[rules-users] generalize a rule in "security.drl" file

Anstis, Michael (M.) manstis1 at ford.com
Thu Nov 8 04:43:05 EST 2007


The use of regular expressions in your pattern match would help.

rule "GeneralisedRestrictAccessClient"
when
    check : PermissionCheck( name matches "/*Edit.xhtml", action == "render"
)
then
    check.grant();
end

You'd best check the RegEx syntax though!
 
Cheers,
 
Mike
 



  _____  

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Mohamed Mhissen
Sent: 08 November 2007 09:26
To: rules-users at lists.jboss.org
Subject: [rules-users] generalize a rule in "security.drl" file


I use restrictions to control access to my pages. 

In my security.drl file, I have : 


Code:	

rule RestrictAccessClientEdit
	when
		check: PermissionCheck(name == "/ClientEdit.xhtml", action
== "render")
  		Role(name == "admin")
	then
		check.grant

();

rule RestrictAccessOrderEdit
	when
		check: PermissionCheck(name == "/OrderEdit.xhtml", action ==
"render")
  		Role(name == "admin")
	then
		check.grant();
end;	


I want to generalize this restriction so to apply it to all pages
publishing: *Edit.xhtml 

I tried like that : 


Code:
check: PermissionCheck(name == "/*Edit.xhtml", action == "render")


Any help would be very welcome, 
Thanks,

-- 
Mohamed Mhissen
mohamed.mhissen at bsaconseil.com
+33.6.65.04.28.79 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071108/7d09c9ee/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4159 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071108/7d09c9ee/attachment.bin 


More information about the rules-users mailing list