Bulk Rule Validation

May 11, 2009 at 5:06 PM

I'm looking for a way to send a collection of rules to AzMan engine and have it validate all the rules.

New RulesQueryCollection, RulesResultsCollection

RulesQueryCollection.Add("Validation Rule 1")

RulesQueryCollection.Add("Validation Rule 2")

RulesQueryCollection.Add("Validation Rule 3")

RulesResultsCollection = Validate(RulesQueryCollection)

Returns a Boolean Value

RulesResultsCollection("Validation Rule 1").Value (True)

RulesResultsCollection("Validation Rule 2").Value (False)

RulesResultsCollection("Validation Rule 3").Value (Null - Rule not found)

That way it's one transaction and one call for a bunch of rules on a screen.

Coordinator
May 11, 2009 at 7:56 PM
Hi,
NetSqlAzMan Biz Rules are intended to be used indirectly (because they are defined on Items) and cannot be invoked in a direct way. The Biz-rules are invoked from CheckAccess process only and are part of the access check chain.
Which are your needs ?

May 11, 2009 at 8:31 PM
Edited May 11, 2009 at 8:33 PM

I'm trying to make AzMan or this app work into either two ways:

A) I send the engine a list of operations I need validated and it returns Yes or No for all of them

B) I can request a list of all the tasks & operations a role is authorized to perform.

Some screens have many authorization rules in order to give a user access to edit certain fields or perform certain functions.  Requesting each rules of wasteful as seperate transactions.  When I login to the app or load a screen I want to get all the authorization in one request and then set my screen properties accordingly.  Then let the cache manager determine when to refresh the requested tasks or operation values.

So in my way the heiarchy is:

Role (Job Title): Manager - Transaction Refund Screen appears in their navigation and they can perform these two actions when on this screen

Task (Application Screen): Transaction Refund Screen

Operation (Screen Functionality): Full Refund

Operation (Screen Functionality): Store Credit

 

Role (Job Title): Lead Cashier - Transaction Refund Screen appears in their navigation and they can perform these two actions when on this screen

Task (Application Screen): Transaction Refund Screen

Operation (Screen Functionality): Full Fund With Approval

Operation (Screen Functionality): Store Credit With Approval

 

Role (Job Title): Cashier

- They would not have the Transaction Refund Screen visible in their navigation because it is not listed in their role.

In my way an empty is a No

 

May 15, 2009 at 10:03 PM
Edited May 15, 2009 at 10:04 PM

We had a similar requirement, and our web developers created the NetSqlAzMan structure as follows:

- Application: Each web page defined as a separate Application (e.g. \Accounting\BudgetApp)
- Roles: Separate Roles defined for various functions on that page. Authorizations are granted to users under each Role.

We extended the WCF Cache to add the following additional methods:

 [OperationContract(Name = "GetUserRoles")]
string[] GetUserRoles(string storeName, string applicationName, string userName);<font size="2">

[OperationContract(Name = "GetAuthorizedApplications")]
string[] GetAuthorizedApplications(string storeName, string userName);

So a call to "GetAuthorizedApplications" gives all the pages the user is authorized for. A call to "GetUserRoles" gives all the functions the user is authorized for.

Hope this helps.

Coordinator
May 15, 2009 at 10:41 PM

Why not using Item Attributes ?

Regards,
Andrea.

May 20, 2009 at 7:58 PM

We had a large number of existing applications where the Roles and Applications already existed in Microsoft AzMan.  These were ported over from AzMan to NetSqlAzMan.