none
How can I stop people doing "Edit Page" on a PDP? RRS feed

  • Question

  • We obviously want our Project Managers to be able to hit "Edit" on PDP pages so they can fill them in, but we don't want them hitting "Edit Page" and accidentally editing the webparts (or worse!)

    How can I limit the ability to "Edit Page" on PDPs, but retain normal access to "Edit"?

    Thursday, October 3, 2019 2:41 PM

All replies

  • project11 --

    Your situation is what I call a "training and performance" issue.  If a user has the Edit Page permission, this means the user can edit a PDP at any time.  Because of this, and your need for PMs to not edit PDPs after initially filling out the page, I recommend you train them how you want it done, and then hold them accountable for their actions.  If you do not have the authority to mandate this, then ask your project sponsor to mandate it.

    Keep in mind that there is no way to configure the permissions in Project Online to allow PMS to edit a PDP initially, but not to edit it later.  Hope this helps.


    Dale A. Howard [MVP]

    Thursday, October 3, 2019 3:57 PM
    Moderator
  • Thanks Dale.

    So there's no way to differentiate between the permission to Edit the project (the button we do want them to use in PWA, as that opens the PDP fields for them to do their weekly report), and to physically edit the PDP page itself? We never want, at any point, the PMs to have the "Edit Page" option available to them.


    • Edited by project11 Thursday, October 3, 2019 4:10 PM
    Thursday, October 3, 2019 4:10 PM
  • Thursday, October 3, 2019 5:40 PM
    Moderator
  • Hi Project11,

    The work around is to hide the "Edit Page" button for everyone except PWA admins using jQuery and JavaScript so that only administrators can see that button to edit the page for others it will not visible.

    The below code will check if the user is part of Admin group or not and then hides the button if the user is non-admin.

    Add the below code in schedule and project details pages via CEWP.

    <script src="<a class="vglnk" href="https://code.jquery.com/jquery-latest.min.js" rel="nofollow">
    <script>
     
    $(document).ready( function()
    function isCurrentUserMemberOfGroup(groupName) {
        var userIsInGroup = false;    
        $.ajax({
            async: false,
            headers: { "accept": "application/json; odata=verbose" },
            method: "GET",
            url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/currentuser/groups",
            success: function (data) {
                data.d.results.forEachfunction (value) {
                    if (value.Title == groupName) {
                        userIsInGroup = true;
                    }
                });
            },
            error: function (response) {
                 console.log(response.status);
            },
        });
        return userIsInGroup;
    }
     
    function HideMasterStyles() {
        var isAdmin=false;
        isAdmin = isCurrentUserMemberOfGroup("Web Administrators (Project Web App Synchronized)"); // //Administrators for Project Web App
        if(!isAdmin){
            //Hide the button you want here for non admins
            $("#Ribbon\\.WebPartPage\\.Edit\\.Edit-Large").css("display""none");
        }
        SP.SOD.executeOrDelayUntilScriptLoaded(HideMasterStyles,'SP.js');
    });
     
    </script>

    incase of any queries, follow my blog, will help you. https://sharepointprojectserver.com/dynamically-hiding-pwa-web-components-for-every-user-except-admin/ 


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    Thursday, October 10, 2019 5:39 AM