Regarding SharePoint 2019 On Premise CustomAction/ CustomActionGroup Element

Will 616 Reputation points
2020-10-21T08:31:35.867+00:00

Hi there,

I create a custom application page with custom action element. the custom action element will used to control the permission of link in the site settings. you could refer to the following image. Unfortunately, when I deploy to the SharePoint Farm and test this by using two different permissions. it turns out that (1) User is Site Administrator (Site Collection Administrator), works well. (2) User is Site Owner or Full Control, the user CANNOT see the link in the site settings.

Is the function supported by SharePoint 2019 on premise or there is something missing. Thanks

33992-untitled.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,298 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,597 questions
0 comments No comments
{count} votes

Accepted answer
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-10-27T06:59:05.907+00:00

    Hi @Will ,

    I tested below 4 scenaios:

    <?xml version="1.0" encoding="utf-8"?>  
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
      
    	<CustomActionGroup  
    		Description = "fffffffff"  
    		Id = "PS.SiteOwnerReports"  
    		Location = "Microsoft.SharePoint.SiteSettings"  
    		Sequence = "10000"  
    		Title = "Test permissions">  
    	</CustomActionGroup>  
      
      
    	<CustomAction  
    		GroupId ="PS.SiteOwnerReports"  
            Id="ViewAllPermissions.SiteSettings"  
    		Location="Microsoft.SharePoint.SiteSettings"  
    		Sequence="10001"  
    		Title = "FullMask-False"  
    		RequireSiteAdministrator="False"  
    		Rights="FullMask"  
        >  
    		<!--   
        Update the Url below to the page you want the custom action to use.  
        Start the URL with the token ~remoteAppUrl if the page is in the  
        associated web project, use ~appWebUrl if page is in the add-in project.  
        -->  
    		<UrlAction Url="~site/_layouts/SharePointProject1/ApplicationPage1.aspx" />  
    	</CustomAction>  
      
    	<CustomAction  
    		GroupId ="PS.SiteOwnerReports"  
            Id="ViewAllPermissions.SiteSettings"  
    		Location="Microsoft.SharePoint.SiteSettings"  
    		Sequence="10001"  
    		Title = "FullMask-True"  
    		RequireSiteAdministrator="True"  
    		Rights="FullMask"  
        >  
    		<!--   
        Update the Url below to the page you want the custom action to use.  
        Start the URL with the token ~remoteAppUrl if the page is in the  
        associated web project, use ~appWebUrl if page is in the add-in project.  
        -->  
    		<UrlAction Url="~site/_layouts/SharePointProject1/ApplicationPage1.aspx" />  
    	</CustomAction>  
      
      
      
    	<CustomAction  
    		GroupId ="PS.SiteOwnerReports"  
            Id="ViewAllPermissions.SiteSettings"  
    		Location="Microsoft.SharePoint.SiteSettings"  
    		Sequence="10001"  
    		Title = "ManageWeb-False"  
    		RequireSiteAdministrator="False"  
    		Rights="ManageWeb"  
        >  
    		<!--   
        Update the Url below to the page you want the custom action to use.  
        Start the URL with the token ~remoteAppUrl if the page is in the  
        associated web project, use ~appWebUrl if page is in the add-in project.  
        -->  
    		<UrlAction Url="~site/_layouts/SharePointProject1/ApplicationPage1.aspx" />  
    	</CustomAction>  
      
    	<CustomAction  
    		GroupId ="PS.SiteOwnerReports"  
            Id="ViewAllPermissions.SiteSettings"  
    		Location="Microsoft.SharePoint.SiteSettings"  
    		Sequence="10001"  
    		Title = "ManageWeb-True"  
    		RequireSiteAdministrator="True"  
    		Rights="ManageWeb"  
        >  
    		<!--   
        Update the Url below to the page you want the custom action to use.  
        Start the URL with the token ~remoteAppUrl if the page is in the  
        associated web project, use ~appWebUrl if page is in the add-in project.  
        -->  
    		<UrlAction Url="~site/_layouts/SharePointProject1/ApplicationPage1.aspx" />  
    	</CustomAction>  
      
    </Elements>  
    

    The result is:

    • If the user is site collection administrator, then he is able to see all links

    35334-test.gif

    • If the user is only site owner, then he can only see the links that have 'false' RequireSiteAdministrator

    35270-test.gif

    So I think you may need to set RequireSiteAdministrator to false. Below is my test demo.

    Best Regards,
    Baker Kong


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Baker Kong-MSFT 3,801 Reputation points
    2020-10-23T07:12:11.363+00:00

    Hi @Will ,

    Based on the docs, RequireSiteAdministrator is used to specify that the item be displayed only if the user is a site administrator. Administrator is not equal to Site owner. For more details, please refer to :

    Best Regards,
    Baker Kong


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.