Pages

Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts

Monday, January 18, 2016

Manage Permissions on List Views for Different Users / Groups in SharePoint 2013

Follow these steps: -
  • Open the list with all items view (ex. Lists/EmployeeMaster/Allitems.aspx). 
  • Go to Site Actions and select Edit Page 
 Now the web part Allitems.aspx will change to the edit mode.
  • Go to the Web Part section and click Web Part Properties.
 Now the web part properties window will displayed in the right side of the web part.
  • In the List Views pane select the view from the dropdown which you need to manage the permissions.
  • In the Advanced pane select the users/ groups under Target Audiences
  • Click OK.
Follow the above steps to manage access levels and grant permission to user/ groups for different list views.

Thursday, August 13, 2015

Allow anonymous access to SharePoint application pages

This post has describe for you how to allow anonymous access to application page without forcing user to provide login credentials.

Setup the Project
1. Open Visual Studio 2013 and Create New Project in “Empty SharePoint Project” and Rename it to “MyFirstAnonymousPageProject”
2. Complete the steps as the usual way when creating a SharePoint project in visual studio 2013.

Add Custom Application Page
1. Right click on the project name “MyFirstAnonymousPageProject” > Add > SharePoint “Layouts” Mapped Folder. This will automatically create a folder with the name of your project under Layout folder.
2. Right click on the folder >Add > New Item > Application Page.
3. Name the page “AnonymousPage.aspx”

Setup anonymous access
1. Go to the code behind part of “AnonymousPage.aspx” page
2. You can see that by default, the page is inherited from “LayoutsPageBase”. Change the inheritance by replacing “LayoutsPageBase” to “UnsecuredLayoutsPageBase”.
Ex: – public partial class AnonymousPage : UnsecuredLayoutsPageBase
3. Next override “AllowAnonymousAccess ” method of the UnsecuredLayoutsPageBase, to allow anonymous access. Set “return true” of the “Get” property.
Ex: -
public partial class AnonymousAccess : UnsecuredLayoutsPageBase
{
    protected override bool AllowAnonymousAccess
    {
        get
        {
            return true;
        }
    }

}

Ready the solution
1. Deploy the solution by right clicking on your project name.
2. Browse the page by navigation to your solution URL once the deployment completed.