MoreCore Platform
Development
Portal - Codebase
Permissions Scheme
MOR-PLN-042 Version 1 Last Review Date: March, 2025

Permissions Scheme

Overview

The permissions scheme within the MoreCore solution in an implementation of Role-based Access Control (RBAC), allowing a User to be assigned one or more roles to give them permissions to perform various functions within the solution.

The permissions scheme is an additive system. Where two roles are assigned to a User, the resulting permissions for the user will be all the where a 'Yes' appears for any of the assigned roles. Only where the permission is 'No' for all roles will that permission be denied.

The Permissions Scheme (or Permissions Matrix) can be found here (opens in a new tab)

This file may change locaiton

Note that some permissions within the platform can be set dynamically in the UI, such as for invoicing tasks.

Key Code Locations

FolderFile
\MoreCore Platform\PMMS\Services\PMMS.Services.DataAccess\DataUpdates\DataUpdates (TBC)
\MoreCore Platform\PMMS\Services\PMMS.Services.DataAccess\Security\Constants.cs
\MoreCore Platform\PMMS\Business\PMMS.Business.Portal\Impl\PermissionResolver.cs
\MoreCore Platform\PMMS\Webs\PMMS.Web.TenantPortalMvc\Scripts\src\app\shared\components\security\security.service.ts

Making Changes to Permissions

Adding a New Role

Update Permissions Scheme
  • Open the Permissions Scheme spreadsheet
  • Insert a column amongst the existing role columns in an appropriate spot
  • fill rows 1 - 12. Row 7 will be determined by the SQL import. TBC What is this? Explanation needed.
  • Add 'Yes' and 'No' in the appropriate places for permissions.
  • Update columns B to L.
  • (MORE INFO NEEDED FOR THIS STEP) You will then need to check the scripts have updated correctly to account for the new role.
Establish a data migration (MORE DETAIL NEEDED)
  • Using Notepad++ Search for the text "INSERT INTO Role" in the DataUpdates folder.
  • Open the most recent file, the example shown is (D:...\DataUpdates\2025-08-30-1400.sql).
  • (MORE INFO NEEDED. LAST STEP WAS TO OPEN EXISTING FILE) Create a new file in the DataUpdates folder with today's date following the naming convention.
  • From Notepad++ copy the text from the file we opened and add it to the new file in the DataUpdates folder.
  • Using the updated scripts the permissions matrix update the new file in the DataUpdates folder.
Update code
  • Follow the below steps for updating existing permissions.
(MORE INFO REQUIRED) Run code generator(s)
Build the project

Updating Existing Permissions

Open the Permissions Scheme.xlsx file
  • Unhide columns between A-M to display the code
  • Row 25 points to what file the column affects, i.e., Constants.cs, PermissionResolver.cs, Security.Service.ts
Update constants.cs
  • In the Permissions Spreadsheet, copy the data in column TBC
  • Open the 'constants.cs' file in the solution.
  • Find the 'TBC' function.
  • Overwrite the data.
  • Save the file.
  • Review the Git Changes for the file to ensure only the expected changes appear.
Update PermissionsResolver.cs
  • In the Permissions Spreadsheet, copy the data in column C.
  • Open the PermissionsResolver.cs file in the solution.
  • Overwrite the data in the 'permissionsresolver' function.
  • Save the file.
  • Review the Git Changes for the file to ensure only the expected changes appear.
Update secutity.service.ts
  • In the Permissions Spreadsheet, copy the data in column E.
  • Open the 'security.service.ts' file.
  • Find the 'initializePermissionMap function.
  • Overwrite the data.
  • Do a find and replace on ',]' with ']' to correct a deficiency in the excel formula.
  • Save the file.
  • Review the Git Changes for the file to ensure only the expected changes appear.
(MORE INFO NEEDED) Run code generator
Build project

Adding New Permissions

TBC

Using Permissions in a View

TBC