23
Views
8
Comments
letting admin see certain features
Question

Hi I have 2 links and a delete button I want to make visible to the app owner account.

I've created the 2 roles "NormalUser" and "RoleToCreateDeleteLocation" and put the relevant conditions in the "visible" sections.

When I login with my main log in however it is not displaying these links and button for me?

Why is this?


roles.PNG
2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello Shaan,

What are the conditions that you are using in the visible properties?

You can use the action CheckRoleToCreateDeleteLocationRole in the Roles folder, passing the GetUserId() as an input. This will allow you to check if the logged user has that specific role.


Kind regards,

Rui Barradas

2021-08-07 15-47-49
Shaan Rashid

Rui Barradas wrote:

Hello Shaan,

What are the conditions that you are using in the visible properties?

You can use the action CheckRoleToCreateDeleteLocationRole in the Roles folder, passing the GetUserId() as an input. This will allow you to check if the logged user has that specific role.


Kind regards,

Rui Barradas

I attached a picture with the visible part showing. It's Client.HasRole


I've attached another picture to this post showing that I added javascript to check the role.


You said about passing an input

Where should GetUserId() go? 

rolejs.PNG
2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello Shaan,

Why are you using a JavaScript node to check the role?


When you create a role, the platform automatically creates some actions that you can use in your logic. One of them is the Check<Role>Role action.


It receives a UserId as an input parameter, where you should put the GetUserId() function (logged user). You can use this to check if you want to display (or not) the button.


Kind regards,

Rui Barradas

2021-08-07 15-47-49
Shaan Rashid

Rui Barradas wrote:

Hello Shaan,

Why are you using a JavaScript node to check the role?


When you create a role, the platform automatically creates some actions that you can use in your logic. One of them is the Check<Role>Role action.


It receives a UserId as an input parameter, where you should put the GetUserId() function (logged user). You can use this to check if you want to display (or not) the button.


Kind regards,

Rui Barradas

How do I put GetUserId() into there whereabouts do I put it?


2020-05-07 18-53-00
Rui Barradas
 
MVP

When you call the action Check<Role>Role, the UserId is the input parameter. You can just type GetUserId() in there.

2021-08-07 15-47-49
Shaan Rashid

Rui Barradas wrote:

When you call the action Check<Role>Role, the UserId is the input parameter. You can just type GetUserId() in there.

Please see my attached picture it is just empty.


getuserid.PNG
2020-05-07 18-53-00
Rui Barradas
 
MVP

You have to call the action in your flow (for example, in the Preparation of the screen).

2020-05-07 18-53-00
Rui Barradas
 
MVP

Shaan, did you manage to do it? Do you need any additional help?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.