web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to remove System user role

(0) ShareShare
ReportReport
Posted on by 390

Hello team,

Whenever I  add an associate to my system I'm assigning a role="Accountant" to that associate but by default a role "system user" gets added to it as well. I don't want that 'system user' role or want to remove 'system user' role for each associate I add .I only want 'Accountant' as the role of the associate.How can I achieve this?   

4606.Role.png

This is my code to add Role to the associate:

 SecurityRole        role;
SecurityUserRole    userRole;
SystemUserEntity systemuser;
select role where role.Name==securityrole; //role=="Accountant"
        select * from userRole
                      where userRole.SecurityRole == role.RecId && userRole.User == systemuser.UserID;

        userRole.User = systemuser.UserID;

        
        userRole.SecurityRole = role.RecId;

        userRole.AssignmentMode = RoleAssignmentMode::Manual;

        userRole.AssignmentStatus = RoleAssignmentStatus::Enabled;
         
        SecuritySegregationOfDuties::assignUserToRole(userRole, null);
        info(strFmt("Role %1 added to the user %2 successfully.", role.Name, systemuser.UserId));

I have the same question (0)
  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi Skd,

    Why do you want to remove it? It is the default role for every user. check thread : community.dynamics.com/.../system-user-role

  • skd Profile Picture
    390 on at

    Hey Vinit Goyal,

    I want to remove it for provide only limited permission to the user. It is a company requirement. The Person with that certain role can't get access to any other modules,forms etc.

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi Skd,

    Did you read the other thread? System user role gives access to bare basic essentials, it will not give user access to any module, forms etc.

  • skd Profile Picture
    390 on at

    Hey  Vinit Goyal ,

    I understand but It's actually my company requirement therefore I have to get it done.

  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi Skd,

    If you remove the System user you get warning like below: 

    pastedimage1598528336591v1.png

    If say yes and remove it user won't be able to open the default screen.

    pastedimage1598528401559v2.pngpastedimage1598528440726v3.png

    Whoever gave you that requirement, ask how will user navigate?

  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi skd,

    What do you want to achieve? what forms or menus you do not want to show?

    If you can identify them we can help you more. We can give you workarounds without deleting the system user role.

    As mentioned above, system user role is essential for the basic functionality of the system.

    Regards,

    M

  • Verified answer
    André Arnaud de Calavon Profile Picture
    300,904 Super User 2025 Season 2 on at

    Hi Sdk,

    As mentioned above, the system user role is required. It will be added when you create a new user. If you really need to restrict the system user role, you can look at the standard role and see if you can create a minimized version of the system user role. In that case, I can imagine you don't want to have the default. However, you would be able to add another role to have 'deny' permissions on certain menu items which should be restricted. It will then override the system user role behavior.

    If you want to restrict the number of legal entities visible when changing the legal entity, you can assign organizations to the system user as well.

    In certain scenarios, there might be indeed a valid reason to not have the system user role assigned out of the box. I have written a blog with use cases and a code example how to prevent having this system user role assigned automatically: dynamicspedia.com/.../

  • skd Profile Picture
    390 on at

    hey André Arnaud de Calavon,

    Thank you so much

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans