Give permissions to users to access only one particular page

Consider the following use case:

You have an intranet site and you want logged in frontend users to be able to access only one particular page without having access to any other page of the site.

Perform the following:

  1. Run your site on IIS
    For more information, see Run projects on IIS
  2. Install an SSL certificate on the frontend of your site.
    For more information, see Administration: Configure SSL » Configuring all frontend pages to require SSL
  3. Make the page to require SSL
    Perform the following:
    1. In Sitefinity CMS backend, click Pages.
    2. Expand the Actions menu of the page that you want to be accessible by the external users.
    3. In the dropdown, click Title & Properties.
    4. Expand Advanced options and select Require SSL checkbox.
    5. Save your changes.
  4. Set all other pages not to require SSL
    Perform the following:
    1. In Sitefinity CMS backend, select Administration » Settings » Advanced » System » Site URL Settings.
    2. Select Remove ssl when the page does not require it checkbox.
      This way, you redirect the pages that does not require SSL to http:// protocol.
    3. Save your changes.
  5. Create a dedicated role which the frontend users will be assigned to.
    Perform the following:
    1. In Sitefinity CMS backend, Administration » Roles » Create a role.
    2. In the input files, enter FrontendUsers and click Create.
      Go back to the Dashboard.
  6. Deny view permissions to all pages.
    Perform the following:
    1. Click Pages.
    2. In the right pane, click Permissions for all pages.
    3. Under View pages, click Change.
    4. Select Explicitly deny this to selected roles and users: checkbox.
    5. Click Add roles or users, select FrontendUsers role, and click Done selecting » Done.
      This way, the frontend users will not be able to see any page from the intranet site.
  7. Give permissions for the specific page only.
    Perform the following:
    1. Go back to Pages and expand the Actions menu of the page that you want to grant permissions for.
    2. In the dropdown, select Permissions.
    3. Click Break inheritance.
    4. Under View this page and its child pages, click Change.
    5. Under Explicitly deny this to selected roles and users: checkbox, remove FrontendUsers and deselect the checkbox.
    6. Select Selected roles or users radio button and click Add roles or users.
    7. Select FrontendUsers and click Done selecting » Done.
    8. Under Edit content of this page and its child pages, perform the same steps.
  8. Setup frontend login page for the users.
    This way, when unauthorized users want to access the page, they will be redirected to the logon page. For more information, see Frontend login page.

    NOTE: When you drop the Registration widget, in the Edit mode, under  Roles, which the user will be assigned to..., click Select roles… and select the FrontendUsers role.

RESULT: When users want to open the frontend page, they will be redirected to the frontend login and registration page. When they register, they will be assigned to the FrontendUsers role. This role has permission to view and edit content only for one particular page and are explicitly denied to view any other page from the intranet site.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?