Sitefinity Access Reporting for Multisite Instances

sitefinity | 2023-12-20

💡 Purpose and Use Cases

The goal of this project is to create an Access Report for Sitefinity CMS, specifically targeting environments with multiple sites.

In Sitefinity, administrators can assign permissions at the page level, either to a specific user or a user role.
Each role, in turn, can have multiple users assigned.

The challenge lies in accurately querying and reporting both direct users and users within roles that have permissions across different multisite instances.

The report is designed to cover the following use cases:

  1. Page Permissions for Individual Users
  2. Page Permissions for User Roles
  3. Full Page URL in the Report
  4. Permission Types:
    • Create
    • Delete
    • Edit Content
    • Modify
      (Any of these operations count as having access)
  5. Only Include Published and Live Pages
  6. Exclude:
    • Backend pages
    • Redirect pages
    • Group pages

🔥 Solution Overview

A sample code has been prepared to address this challenge.

The solution approach:

  1. Loop through pages across all multisite instances.
  2. Filter only the required pages based on publication status and page type.
  3. Query page operations and permissions, capturing both:
    • User IDs
    • User Role IDs
  4. Resolve users associated with:
    • Direct permissions
    • Role-based permissions
  5. Structure the report into a clean CSV format for easy review and export.

📚 References

🔗 Codes

Access the working sample on GitHub Gist: