189
Views
4
Comments
Grant User Role by dynamic name evaluation
Question
We're building a user security app.  We're using the Roles and User tables so we can take advantage of the Check, Grant and Revoke functions.  We would like to be able to dynamically determine which Check/Grant/Revoke function to at run-time without having to pre-define and ugly switch/lookup action.  Is there any way to do this?  perhaps with some kind of string evaluation like
Grant{AccountHolder}Role(UserId:)
where AccountHolder would be the 'name' value in the Roles table 
2016-04-21 20-09-55
J.
 
MVP
err,

It's a bit hard to read what your actual question is.

anyways, the answer is No for now.

2021-04-17 17-51-40
George Jeffcock
do you mean at design time you don't code the function/method/action to invoke/call but invoke via dynamic call like in C# and Java you could use Reflection or C++ you can load DLL at runtime or execute from a command line etc. This technique I have used in dynamic menu systems and automated testing but most dislike for security reasons. Sorry I can't say if Outsystems supports dynamic calling of user actions, cant find any mention of it except for https://www.roelvanlisdonk.nl/?p=3545  which i got from https://www.outsystems.com/forums/discussion/10139/dynamically-calling-an-action/


2020-04-17 08-41-30
Tim Timperman
Is it not easier to just manipulate the User_Role table directly? (create-update-delete)
This allows you to do exactly what you need.
2020-03-17 03-08-19
Steve Bramley
Tim Timperman wrote:
Is it not easier to just manipulate the User_Role table directly? (create-update-delete)
This allows you to do exactly what you need.
 Thanks Tim.  Yeah I was thinking that shortly after I wrote this request.  I'm new to OS and was leery of poking my greasy paws into system tables directly.  
 
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.