Cascading permissions on OR instead of AND

Topics: General Topic
Jun 20, 2012 at 8:07 PM

I have several similar needs where I'd like to setup a task ("Task 1") and have multiple operations associated with it ("Operation 1", "Operation 2", "Operation 3") such that Task 1 is allowed if ANY of Operation 1,2, or 3 is allowed.  If I create a Task called Task 1 and add three operations to it called Operation 1, 2, and 3 respectively, then running Check Access Test will perform as follows:

  • If none of the operations are allowed, it is neutral (desired behavior)
  • If Operation 1 is allowed then Task 1 still shows neutral

I'd like it so that if either 1, 2, or 3 are allowed then Task 1 is allowed.  This affords flexibility in designing the items in some cases.  Is there any way to achieve this?

Jun 21, 2012 at 7:09 AM

Hi,

a possible workaround is to create a Task for each operation (Task 1 => Operation 1, Task 2 => Operation 2, …).

When you check the access do something like:

Boolean result = checkAccess(Task1) || checkAccess(Task2);

If (result)

doSomething();

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com