Function-based parametric roles

If there is something important you think is missing in the current version of LSPS then you can post a feature request here.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
Byron Glueck
 
Posts: 85
Joined: Thu Apr 26, 2012 8:17 pm

Function-based parametric roles

Thu Apr 17, 2014 3:04 pm

When configuring and assigning parametric roles, we would like to be able to define function-based values that could be evaluated at run-time.

A current example of roles is:
Define a role (e.g., Manager) with a parameter of 'department' or 'departmentId', which is some kind of unique identifier.

Assignment of this role may look like:
Manager(["department"->"Shoes"]) or Manager(["departmentId"->"4"])

In order to change this role assignment in code, a task like RemovePersonFromRole and AddPersonToRole could be executed, but this may prove cumbersome?

Suggestion:
Define the role using a function as its configured value (e.g., a closure construct):
Parameter: "departmentId"
Value: { : Integer } or { : Set<Integer> }

Then its assignment to a user could look like:
Manager(["departmentId"-> { : getDepartmentId() } ])

The getDepartmentId() function may check the currently logged-in person's relevant business data/attributes.

This way, if the user's department changes or he/she is assigned new ones via business data, no administration is necessary for the user's new role parameters to be applied.

This may be an expensive operation when it comes to role membership checking in code? However, it would make user/role management more dynamic.

Thanks.

matt.price
 
Posts: 66
Joined: Thu May 03, 2012 11:51 pm

Re: Function-based parametric roles

Fri Apr 18, 2014 11:16 pm

To speak to one particular business case and the note about being cumbersome: the too many roles to manage manually.

One our our most recent projects, we have a role that is driven by hundreds of individual items. This would create hundreds of parameters in the system.

So for Byron's example, imagine you had a role per shoe manufacturer in the shoe department. Maybe that's not hundreds of manufacturers, but for the sake of the example...

What are the alternatives? Some back-end DB script that runs nightly?

Ondrej Danko
 
Posts: 31
Joined: Mon Feb 27, 2012 1:14 pm

Re: Function-based parametric roles

Tue Apr 22, 2014 10:49 am

Hi all,

As Byron mentioned in the original post, dynamic values of role parameters would be a performance overkill. We need to store parameter values as simple types in the DB to perform efficient queries (e.g. to retrieve todo list for given person).

If I understand correctly your situation is the following:
1) value of role parameter assigned to some person is "determined" by some data stored in some external system
2) data stored in that external system are changing "often"
3) the issue is how to:
3a) detect that data has been changed in the external system
3b) recompute roles in LSPS based on the changes in the external system

3a) is application specific question. Ideally, the external system should notify LSPS application when data are changed that role should be recomputed. If this is not possible, then some kind of pooling must be applied (LSPS periodically checks external system).

3b) Apart from management console, you can update roles assignments programmatically through webservice interface, java API (PersonManagementService) or model as mentioned in the original post (AddPersonToRole task).

Hope this helps.

Thanks.

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 1 guest