How to disable or enable button based on user roles

How to disable or enable button based on user roles

  

Hi Team,

I am  completely  new  to  Outsystems. I want  to  enable  edit  button  based  on  user role.


Thanks  in  Advance.



Regards,

Kallol


Solution

Hi Kallol,

You can do by checking the roles by user, do the following,

In service studio -> Logic -> Roles -> (your user role), when you expand you see 3 actions pre-defined by default, Like 

1) Check<rolename>

2) Grand<rolename>

3) Revoke<rolename>


Here you can use this in your screen by calling Check<rolename> action passing the logged-in user.

After you use if widget and make condition "Check<rolename>(userid)", true part put real button enabled, and else part put dummy button with disabled.

This way no one do tricks to enable the button from client side.


Thanks,

Balu

Solution

Kallol Jena wrote:

Hi Team,

I am  completely  new  to  Outsystems. I want  to  enable  edit  button  based  on  user role.


Thanks  in  Advance.



Regards,

Kallol



Hi Kallol,

If you are completely new I would suggest going with the online course before you start anything they have explained each and everything there.

refer this link for the reference.


Regards,

Pankaj Pant

Pankaj pant wrote:

Kallol Jena wrote:

Hi Team,

I am  completely  new  to  Outsystems. I want  to  enable  edit  button  based  on  user role.


Thanks  in  Advance.



Regards,

Kallol



Hi Kallol,

If you are completely new I would suggest going with the online course before you start anything they have explained each and everything there.

refer this link for the reference.


Regards,

Pankaj Pant

Hi  Pankaj,


Thanks  for  your  reply.

I watched  all  the  videos  whatever  present  in  Youtube. But,I didn't  find  any  solution.


Regards,

Kallol


Balu wrote:

Hi Kallol,

You can do by checking the roles by user, do the following,

In service studio -> Logic -> Roles -> (your user role), when you expand you see 3 actions pre-defined by default, Like 

1) Check<rolename>

2) Grand<rolename>

3) Revoke<rolename>


Here you can use this in your screen by calling Check<rolename> action passing the logged-in user.

After you use if widget and make condition "Check<rolename>(userid)", true part put real button enabled, and else part put dummy button with disabled.

This way no one do tricks to enable the button from client side.


Thanks,

Balu

Nice tips


Balu wrote:

Hi Kallol,

You can do by checking the roles by user, do the following,

In service studio -> Logic -> Roles -> (your user role), when you expand you see 3 actions pre-defined by default, Like 

1) Check<rolename>

2) Grand<rolename>

3) Revoke<rolename>


Here you can use this in your screen by calling Check<rolename> action passing the logged-in user.

After you use if widget and make condition "Check<rolename>(userid)", true part put real button enabled, and else part put dummy button with disabled.

This way no one do tricks to enable the button from client side.


Thanks,

Balu

Hi Balu,

Thank you  very much.


It  helped   me  a  lot .


Thanks,

Kallol