Skip to main content

Notifications

Announcements

No record found.

Customer Service forum
Suggested answer

Restrict entity access for the User added through Access Team Template

Posted on by 449

We have a requirement to assign both Technical and Business users to each application in order to complete technical and business data. It is important that both types of users are not allowed to edit each other's data. To fulfill this requirement, we used an Access Team Template that allows us to assign specific users with access to the application. Our process involved:

  1. Creating an "App Read Only Role" with edit access to all related entities.
  2. Assigning the "App Read Only Role" as the default role.
  3. Allowing the App Admin to add users to either the Technical or Business Access Team for a specific application.

However, we have encountered an issue where Business users are able to add data to the Subgrid on the Technical page. This is problematic because only Technical users are allowed to edit the value of the Subgrid on the Technical page. We need to ensure that non-technical users are not able to add existing data to the Subgrid.

how we can hide the 'Add Existing..' button for the Subgrid on the technical page for non technial users. 

Categories:
  • Suggested answer
    Sayen Zhang Profile Picture
    Sayen Zhang on at
    RE: Restrict entity access for the User added through Access Team Template

    Hi SivaR,

    Hope you are well.

    Here are the steps to hide the 'Add Existing...' button for the Subgrid on the technical page for non-technical users.

    1. Download Ribbon Workbench: Develop 1 Ltd | Ribbon Workbench for Dynamics 365 & Dynamics CRM

    2. Select the environment that you want to hide the 'Add Existing...' button for the Subgrid.

    3. Go to Advanced Settings > Solutions > Import > Choose the file we download.

    4. Find non-technician's security role GUID and then enter in js code to hide 'Add Existing...' button.

    pastedimage1683789836960v2.png

    5. Go to Advanced Settings > Customizations > Customize the system > Web Resource > create a new Web Resource

    function hideButtons(){
    var value = true;
        var basicuserGuid = "70110B17-CCE0-ED11-A7C6-000D3A35619A";
        var userRoles = Xrm.Utility.getGlobalContext().userSettings.securityRoles;
        for (var i = 0; i < userRoles.length; i++) {
           if (userRoles[i].toUpperCase() == basicuserGuid.toUpperCase()){
              value = false;
              break;
           }
        }
       return value;
    }

    pastedimage1683789972874v3.png

    6. Create a new solution and add form that you want to hide the button.

    7. Go to Advanced Settings > Solutions > Click Ribbon Workbench

    pastedimage1683787041511v1.png

    8. Click 'Add Existing...' button and create an enable rule.

    pastedimage1683790279668v5.png

    9. Save and Publish.

    You can also refer to this link: Hide show button on security role using JavaScript and ribbon workbench Dynamics 366 or Dataverse | Softchief Learn

    Best Regards,

    Sayen Zhang

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans