In site setting I want to hide a link in the Site Actions group from the Full Control users.
Anyone can point me to the right direction?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Modify Site Metadata seems like it's a custom action, you need to return to the code used to add it. CSOM accepts
Rights attribute, which are based on SPBasePermission enumeration. You need to define a higher-than-site-owner-level permission right, which would be
So, add the following to your code:
Rights = "ManageWeb"
The complete code would be something like:
UserCustomAction siteAction = clientContext.Web.UserCustomActions.Add(); siteAction.Group = "SiteActions"; siteAction.Location = "Microsoft.SharePoint.StandardMenu"; siteAction.Name = "Sample_CustomAction"; siteAction.Sequence = 1000; siteAction.Url = string.Format(DeployManager.appUrl, clientContext.Url); ; siteAction.Title = "Modify Site Metadata"; siteAction.Rights = "ManageWeb"; siteAction.Update(); clientContext.ExecuteQuery();