Hide/Remove the site contents and site settings on user site (sharepoint 2013)

The mysites by default is created by user itself,  and all the user have owner permissions so they can do every thing on the MySite like open the site content and site setting so please how i can change this permission should i delete the user profile service application and edit the permission before ???



May 18th, 2015 7:34am

Hi Kadomi,

From your description, my understanding is that you want to restrict your users to access site content and site setting pages.

You could use CSS code to hide site content and site settings, please refer to this code below:

<style type="text/css">
a[title='Site contents']
{
display:none;
}
a[title='Site settings']
{
display:none;
}
</style>

You could restrict users to access these pages with http module check if current URL contains the URL of site these pages, if current URL contains the URL of site content or site setting you could redirect to a new page to warn uses that they do not have permission to access this page.

you could refer to this code below to check current URL in http module:

if (HttpContext.Current.Request.Url.AbsoluteUri.Contains(_layouts/15/viewlsts.aspx)||HttpContext.Current.Request.Url.AbsoluteUri.Contains(_layouts/15/settings.aspx))

{

                HttpContext.Current.Response.Redirect(special page);

}

Please refer to this article about how to use http module in SharePoint 2013:

SharePoint & Http Module Example

http://www.jeanpaulva.com/index.php/2014/10/30/sharepoint-http-module-example/

Best Regards,

Vincent Han

Free Windows Admin Tool Kit Click here and download it now
May 22nd, 2015 9:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics