# RolePermissionsController

**Kind:** Controller

**Source:** `Pams/API/Pams.API/Controllers/Security/RolePermissionsController.cs` (line 21)

**Part of:** [Pams](subsystem-pams)

## Where it refuses work

- `RolePermissionsController` stops the work with an early return when `!ModelState.IsValid`, in 3 places.
- `RolePermissionsController` stops the work with an early return when `objId <= 0 || moduleId <= 0`.
- `RolePermissionsController` stops the work with an early return when `!NewRole.Save()`.
- `RolePermissionsController` stops the work with an early return when `!RPLogic.SaveBulk(EntityList)`.
- `RolePermissionsController` stops the work with an early return when `!Rolperm.HasObject`.
- `RolePermissionsController` stops the work with an early return when `!Rolperm.Delete()`.

## When something fails

- `RolePermissionsController` handles failure in 14 places: it turns it into a return value in all 14.

## Relationships

- MODULE_DECLARES → `GetByRoleID`
- MODULE_DECLARES → `GetUserPremissions`
- MODULE_DECLARES → `GetUserPermissionsForNewList`
- MODULE_DECLARES → `GetUserPermissionsForOpenedSheet`
- MODULE_DECLARES → `Insert`
- MODULE_DECLARES → `HasPermission`
- MODULE_DECLARES → `GetPageId`
- MODULE_DECLARES → `GetCompany`
- MODULE_DECLARES → `GetUserPermissionLevel`
- MODULE_DECLARES → `SaveRolePermissions`
- MODULE_DECLARES → `Delete`
- IMPORTS → `BaseController`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `GetAll`
- IMPORTS → `RolePermission`
- IMPORTS → `RolePermissionBindingModel`
- IMPORTS → `Proc_RolePermissions`
- IMPORTS → `Proc_RolePermissionsBindingModel`
- IMPORTS → `UserPremissionsModel`
- IMPORTS → `Insert`
- IMPORTS → `Insert`
- IMPORTS → `Role`
- IMPORTS → `Save`
- IMPORTS → `GetUserPermissions`
- IMPORTS → `HasPermissionModel`
- IMPORTS → `HasPermissionResult`
- IMPORTS → `StringModel`
- IMPORTS → `Delete`
- IMPORTS → `Delete`
- IMPORTS → `Delete`

## Used by

4 references from 4 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### calls by (4)

- `Auth` — `Outlook_plugin/src/auth/auth.service.ts`:1
- `AppSettings` — `Frontend/src/app/settings/app/app.settings.ts`:241
- `AppSettings` — `Pams/Web/Pams.Web/Client/app/settings/app/app.settings.ts`:126
- `AppSettings` — `Pams/Web/Pams.WebApp/Client/app/settings/app/app.settings.ts`:6
