Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Restrict entity access for the User added through Access Team Template

(0) ShareShare
ReportReport
Posted on by 34

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. 

  • 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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans