[rules-users] Complicated Grant Permissions Logic
Wolfgang Laun
wolfgang.laun at gmail.com
Wed May 18 13:22:17 EDT 2011
Neither $submitter nor $requester are defined in the rule as you posted it,
so
there's no way of telling where the problem might be.
Note that '&&' binds stronger that '||' and use parentheses to force
precedence.
-W
On 18 May 2011 18:40, ginni <ginni at aero.org> wrote:
> Hi,
>
> I am new to Drools and would just like to understand how to do what I am
> trying to do. This syntax does not work, and I am not sure how to make it
> work. I want permission granted if:
>
> User is Librarian
> OR user is Submitter OR user is Requester AND requestSubmitted is false
> AND
> requestCancelable is true
>
> This syntax requires the user to be both librarian AND submitter or
> requester.
>
> when
> $perm: PermissionCheck(target == "libraryRequest", action ==
> "cancelRequest", granted == false)
> RequestState($requestCancelable: requestCancelable, $requestSubmitted:
> requestSubmitted)
> Role(name == "APP_LIBRARY REQUESTS_LIBRARY STAFF")
> eval($requestCancelable == true ||
> ($submitter.getBadgeNumber().equals($userBadge) ||
> $requester.getBadgeNumber().equals($userBadge) && !requestSubmitted))
> )
>
> Any help would be greatly appreciated!!
>
> Thanks,
> Ginni
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Complicated-Grant-Permissions-Logic-tp2957702p2957702.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110518/040417ec/attachment.html
More information about the rules-users
mailing list