Roles and access
Who may call what, and how roles and permissions are set.
In this documentation
- Beep.OilandGas Documentation
- Overview
- Architecture
- BeepDM integration
- Database scripts
- Configuration
- Company and field scoping
- Roles and access
- REST API reference
- Web application pages
- Exploration and prospects
- Development and drilling
- Production operations
- Production accounting
- HSE, permits and compliance
- Decommissioning
- Engineering calculators
- Troubleshooting
This page lists how the API decides who may call what. It is taken from the authorization code and the controller attributes.
1. Signed-in account
- Every endpoint requires an authenticated caller with an active OilGas account. This is the default and the fallback policy. An account counts as active when the API itself has issued a party identity claim and an active-account claim for it.
- Anonymous endpoints are
/healthand/health/repository. The account state endpoint under/api/auth/repositoryaccepts any signed-in caller so that it can tell a disabled account what is wrong. - A small set of first-time setup paths is protected by a setup key instead of a sign-in, because the identity store may not exist yet.
2. The first administrator
The first person to complete the first registration of a new installation receives the Administrator role. The code creates the role if it is missing, adds the person to it and records the reason "First OilGas registration". A singleton bootstrap record makes sure only one registration can win. Later registrations do not receive the role.
3. Roles named in the code
Role names are plain strings checked with the framework's role authorization. Administrators can also create more roles through the API (see section 6), so this list covers only the names the code itself checks.
| Role | Where it is required |
|---|---|
| Administrator | Most administration endpoints: access control and grants, asset hierarchy, role and persona administration, user management policies, initial company setup, module and system repository setup, PPDM39 setup, lease acquisition creation and status changes, and the Failures page. |
| Accountant or Administrator | Accounting period checks (GET /api/field/current/accounting/period-checks) and closing a period (POST /api/field/current/accounting/close-period, which also needs write access to the field). |
| GateApprover | Three actions on gate reviews under /api/field/current/gates. The gate review pages in the web application also admit Manager and Admin. |
| Compliance | One action in the business process compliance controller (/api/field/current/process/compliance). |
| Supervisor, Manager or Admin | Deleting a work order (DELETE /api/field/current/workorder/{instanceId}). |
| Admin or Administrator | Connection management (/api/connections) and the demo database endpoints (/api/demo). |
4. Named policies
| Policy | Rule |
|---|---|
Admin.ManageUsers | The caller has an active account and the Administrator role. |
Admin.AssignRoles | The caller has an active account and the Administrator role. |
HSE.ManageIncidents | The caller has an active account and a permission claim with that value. |
HSE.ReportIncident | The caller has an active account and a permission claim with that value. |
5. Permissions
The permission names are constants in PermissionConstants. They are grouped by area, for example Admin, Security, DataManagement, Inventory, Procurement, Accounting, Tax, EconomicAnalysis, WellManagement, Production, ProductionForecasting, ProductionAccounting, Reservoir, Drilling, Completions, Facilities, Pipeline, NodalAnalysis, WellTestAnalysis, ChokeAnalysis, CompressorAnalysis, GasLift, PumpPerformance, SuckerRodPumping, PlungerLift, HydraulicPumps, EnhancedRecovery, HSE, Environmental, Regulatory, Exploration, ProspectIdentification, LeaseAcquisition and DevelopmentPlanning. A permission name has the form Area.Action, for example HSE.IssuePermit, Production.AllocateProduction or NodalAnalysis.RunVLP.
Which role holds which permission is stored data that an administrator manages (see the role permission endpoints below). It is not fixed in the code, so this documentation does not list default grants.
Access to a particular field, well or other asset is a separate check: POST /api/AccessControl/check-access answers whether a user has access to an asset with a given permission, and administrators grant or revoke asset access.
6. Administration endpoints
Roles and users
| Method | Route | Body | Query | Access |
|---|---|---|---|---|
| GET | /api/identity/roles | role Administrator | ||
| POST | /api/identity/roles | role Administrator | ||
| GET | /api/identity/roles/catalog | role Administrator | ||
| GET | /api/identity/roles/permissions/catalog | role Administrator | ||
| GET | /api/identity/roles/users/{targetUserId}/assignments | role Administrator | ||
| POST | /api/identity/roles/users/{targetUserId}/assignments | AssignRoleRequest | role Administrator | |
| DELETE | /api/identity/roles/assignments/{userRoleId} | role Administrator | ||
| GET | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/users/{targetUserId}/access | role Administrator | ||
| POST | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/memberships | CompanyMembershipRequest | role Administrator | |
| GET | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/users/{targetUserId}/assignments | role Administrator | ||
| POST | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/users/{targetUserId}/membership-retirements | CompanyMembershipRetirementRequest | role Administrator | |
| GET | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/users/{targetUserId}/membership-retirements | offset, limit | role Administrator | |
| POST | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/users/{targetUserId}/assignments | AssignCompanyRoleRequest | role Administrator | |
| DELETE | /api/identity/roles/tenants/{tenantId}/companies/{businessAssociateId}/assignments/{userRoleId} | role Administrator | ||
| GET | /api/identity/roles/{roleId}/permissions | role Administrator | ||
| POST | /api/identity/roles/{roleId}/permissions | GrantPermissionRequest | role Administrator | |
| DELETE | /api/identity/roles/permissions/{rolePermissionId} | role Administrator | ||
| GET | /api/identity/users | policy Admin.ManageUsers | ||
| GET | /api/identity/users/{targetUserId} | |||
| PUT | /api/identity/users/{targetUserId} | RepositoryUserUpdate | ||
| GET | /api/identity/users/{targetUserId}/roles | |||
| POST | /api/identity/users/{targetUserId}/roles | UserRoleChangeRequest | policy Admin.AssignRoles | |
| DELETE | /api/identity/users/{targetUserId}/roles/{roleName} | policy Admin.AssignRoles |
Asset access, hierarchy and profiles
| Method | Route | Body | Query | Access |
|---|---|---|---|---|
| GET | /api/AccessControl/user/{targetUserId}/stored-grants | offset, limit | role Administrator | |
| GET | /api/AccessControl/fields/{fieldId}/interest-review | role Administrator | ||
| POST | /api/AccessControl/stored-grants/{grantId}/retire | Beep.OilandGas.Models.Data.AccessControl.RetireAssetGrantRequest | role Administrator | |
| GET | /api/AccessControl/stored-grants/{grantId}/retirements | offset, limit | role Administrator | |
| POST | /api/AccessControl/check-access | AccessCheckRequest | ||
| GET | /api/AccessControl/user/{targetUserId}/assets | assetType, organizationId, includeInherited | ||
| GET | /api/AccessControl/user/{targetUserId}/roles | organizationId | ||
| GET | /api/AccessControl/user/{targetUserId}/permission/{permissionId} | organizationId | ||
| POST | /api/AccessControl/grant-access | GrantAccessRequest | role Administrator | |
| POST | /api/AccessControl/revoke-access | RevokeAccessRequest | role Administrator | |
| GET | /api/AccessControl/role/{roleId}/permissions | organizationId | role Administrator | |
| POST | /api/AccessControl/role/{roleId}/permission/{permissionId} | organizationId | role Administrator | |
| DELETE | /api/AccessControl/role/{roleId}/permission/{permissionId} | organizationId | role Administrator | |
| GET | /api/AssetHierarchy/organization/{organizationId} | rootAssetId, rootAssetType, rootFacilityType | role Administrator | |
| GET | /api/AssetHierarchy/user/{targetUserId} | organizationId, rootAssetId, rootAssetType, rootFacilityType | ||
| GET | /api/AssetHierarchy/asset/{assetId}/{assetType}/children | organizationId, facilityType | role Administrator | |
| GET | /api/AssetHierarchy/asset/{assetId}/{assetType}/path | organizationId, facilityType | role Administrator | |
| POST | /api/AssetHierarchy/validate-access | ValidateAccessRequest | ||
| GET | /api/AssetHierarchy/organization/{organizationId}/config | role Administrator | ||
| PUT | /api/AssetHierarchy/organization/{organizationId}/config | List<HierarchyConfig> | role Administrator | |
| GET | /api/UserProfile/{targetUserId} | |||
| GET | /api/UserProfile/{targetUserId}/roles | organizationId | ||
| GET | /api/UserProfile/{targetUserId}/default-layout | |||
| PUT | /api/UserProfile/{targetUserId}/preferences | UpdatePreferencesRequest | ||
| PUT | /api/UserProfile/{targetUserId}/primary-role | UpdatePrimaryRoleRequest | ||
| PUT | /api/UserProfile/{targetUserId}/preferred-layout | UpdatePreferredLayoutRequest | ||
| POST | /api/UserProfile/login |
Personas
A persona is a named working view (workspace) that can be mapped to a role. The persona endpoints list the catalog, show the workspaces for the current user, and let administrators map workspaces to roles.
| Method | Route | Access |
|---|---|---|
| GET | /api/personas | |
| GET | /api/personas/workspaces/current | |
| GET | /api/personas/roles/{roleId}/workspaces | role Administrator |
| PUT | /api/personas/roles/{roleId}/workspaces/{code} | role Administrator |
| PUT | /api/personas/{code} | role Administrator |
| GET | /api/personas/users/{targetUserId} | |
| PUT | /api/personas/users/{targetUserId} | |
| GET | /api/personas/users/{targetUserId}/preferences/{code} | |
| PUT | /api/personas/users/{targetUserId}/preferences/{code}/{viewKey} |
Row level checks
| Method | Route | Body |
|---|---|---|
| POST | /api/identity/security/check-row-access | CheckRowAccessRequest |
| POST | /api/identity/security/apply-row-filters | ApplyRowFiltersRequest |
| POST | /api/identity/security/check-source-access | CheckSourceAccessRequest |
| POST | /api/identity/security/check-database-access | CheckDatabaseAccessRequest |
| POST | /api/identity/security/check-datasource-access | CheckDataSourceAccessRequest |
| GET | /api/identity/security/accessible-fields | |
| GET | /api/identity/security/accessible-assets | |
| GET | /api/identity/security/accessible-organizations |
7. In the web application
| Page | Route | Access |
|---|---|---|
| Users | /admin/access-control/users | Administrator |
| Assign User Roles | /admin/access-control/user-roles | Signed in; the API calls it uses are administrator calls |
| Asset Access | /admin/access-control/asset-access | Administrator |
| Organisation Hierarchy Configuration | /admin/access-control/hierarchy-config | Administrator |
| Failures | /admin/failures | Administrator |
| Company members | /setup/company-members | Company membership setup |
| Gate Reviews | /ppdm39/process/gates | GateApprover, Manager or Admin |