Recommended architecture: Filtering data

May 21, 2009 at 9:52 AM

What is the recommended way of using NSAM to filter data based on user?

For eg, we have a website that runs reports. Only certain users are allowed to run certain reports.

So far so good - Create business Roles, each Report is a Task, the name of the web pages is an Operation (ie "Load MyReport1.aspx").

Right?

If one of the parameters for this report is a dropdown list of items from a table in the db. Certain users are only allowed to request certain items, so only these items should be loaded into the list.

How would one implement this in such a way that the contents of the list could be managed per user using NSAM?

 

Thanks in advance for any guidance...

May 21, 2009 at 10:21 AM

Actually, on re-reading the question I don't think I have given the full scope of the issue. The limits on which items a User is allowed to see in the list cuts across applications and scenarios. There are certain ones they can use and certain ones they can't, and this needs to be configured in a single place.

Should i create a unique application, and each item in the list is a Task? Feels dirty, there must be a better way...

 

Coordinator
May 21, 2009 at 4:43 PM

Hi,

I suggest you to create an Operation for each Report (with the name of the report itself) …then aggregate all report’s operations to one Task and associate this task to the several Roles.

The architecture should be:

1) The application ask NetSqlAzMan if User “u1” can view the Report “R1” (that is an operation)

2) The report could be print from several ASP.NET pages … so the question should be … User “u1” could print the report “R1” ? And not … if he can view page P1 (if you intend to print the report R1).

Regards,

Andrea.

Coordinator
May 21, 2009 at 4:45 PM

Si my previous response.

Your application ask NetSqlAzMan if a user “u1” can perform a given operation “o1” …

Task are for Administrative use only … but they are not necessarily.

Regards,

Andrea.

May 22, 2009 at 9:29 AM
Edited May 22, 2009 at 9:44 AM

Ok - let me give a real world example of what I need to do:

We have a table called dbo.Countries. Countries has 5 rows, 1-England, 2-Ireland, 3-India, 4-Italy, 5-South Africa.

Data within each Report is filtered by Country. An administrator must say which User can see which (one or more countries).

So, the Report is an Operation, and they all aggregate to the "Run Reports" task, which can be assigned to one or more Roles. But at what point do you say that this person can see only England, but this person can see India and Italy...?

 

Coordinator
May 22, 2009 at 10:01 AM

Now I have understtod.

Attributes are the solution (see attributes on the guide).

Regards,

Andrea.