SBX - Search With Button

SBX - Forum Post Title

How to Enabeled No/Yes a button based on Security Role

Dynamics 365 for Finance and Operations Forum

AX Primary school student asked a question on 13 Jun 2019 2:51 AM

Question Status

Verified

Hello All,

How should I do  for getting current role of User .  

Can anyone help me on this ?   Thank you :)

Reply
Verified Answer

Please refer this blog post community.dynamics.com/.../get-user-roles-associated-with-current-user it has example how to get all roles for current user.

Reply

Hi,

Can you explain your question? It seems like the title and content of your question are not completely matching. At least it confuses me what you want to learn.

Reply

Why you want to find role  through code and then disable button with code . Can you do that using security settings ?

Reply
Sourav Dam responded on 13 Jun 2019 2:28 PM
My Badges

Hi,

The question is not quite clear to me. However would like to know if this is something you are looking for as mentioned below.

--- Disable the 'Enabled' check box at user level in 'User' form? If YES, then this access should be lying with the person who has been assigned to system admin role. If you don't give access to any common user to get through this module, then he/she will never be able to access this module.

--- Whether you want to see what are the roles assigned to a particular user? If YES, then you can filter the record in 'User' form > select the particular user and click on the User ID. It will take you inside that user detail where you can find list of roles assigned. Else, you can click on the right arrow of 'Related Information' area in the 'User' form. It will list down all roles whatever is assigned to that user.

Best regards,

Sourav Dam

Reply
AX Primary school student responded on 13 Jun 2019 8:55 PM

Yes Yes Can you tell me more specific about using security settings to control button

Reply
AX Primary school student responded on 13 Jun 2019 8:57 PM

thank you very much for help me

Reply
Suggested Answer

Look at this link and read about NeededPermission Property of a Control

docs.microsoft.com/.../security-permissions-properties-for-a-form

Reply
AX Primary school student responded on 13 Jun 2019 11:49 PM

Thank you

Reply
AX Primary school student responded on 13 Jun 2019 11:50 PM

Thank  you it works

Reply
Verified Answer

Please refer this blog post community.dynamics.com/.../get-user-roles-associated-with-current-user it has example how to get all roles for current user.

Reply
Suggested Answer

Look at this link and read about NeededPermission Property of a Control

docs.microsoft.com/.../security-permissions-properties-for-a-form

Reply

SBX - Two Col Forum

SBX - Migrated JS