Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello IoT Community!
I would like to build my mashups in a way, that some buttons (or other widgets) are Enabled/Disabled depending on whether the user has the permission for the underlying service (e.g the service executed when clicking that button).
For that I thought I could write an expression that checks whether the current user has permission for a specific service. Do you have any Ideas how to write a simple expression for that?
As far as I know, an error is thrown when a user tries to execute a service he has no permission for. So maybe I could somehow "catch" the error in the expression?
Maybe something like
try(functionToExecute())
{
return true;
} catch(error){
return false;
}
Unfortunately I have no idea how to implement this behavior...
Any advices are appreciated very much!
Best Regards,
Dominik
Solved! Go to Solution.
What you mentioned is possible, but I think the better approach would be the use of User Groups and checking if a user is in a particular group.
So you can set up User Groups that define certain roles or permissions sets
'Manager' 'Operator' etc.
or 'xyz Read' 'xyz Update'
Then at whatever moment you can use 'GetCurrentGroups' to retrieve the user groups the user is part off and then verify that against your set of permissions groups and then apply enable/disable/visible/invisible
What you mentioned is possible, but I think the better approach would be the use of User Groups and checking if a user is in a particular group.
So you can set up User Groups that define certain roles or permissions sets
'Manager' 'Operator' etc.
or 'xyz Read' 'xyz Update'
Then at whatever moment you can use 'GetCurrentGroups' to retrieve the user groups the user is part off and then verify that against your set of permissions groups and then apply enable/disable/visible/invisible
Works like a charm, thanks a lot!