Roles and Permissions
Use this guide when configuring administrator access or adding permission-aware dashboard code. Attendee audiences, portal-page grants, project API keys and plugin tokens have separate authorization contracts; an administrator role is not a replacement for those credentials. See Authentication Architecture and Authorization Architecture.
For team settings, invitation/acceptance, resend scope and membership lifecycle, follow Team Settings, Invitations and Membership. Invitation grants and later member-assignment controls have different scope validation; review the workflow you actually use.
Configure administrator access
- Select the intended team in the dashboard. Membership and effective permissions are separate: adding a person to the team does not grant every action.
- Use Roles to inspect or configure a role's permission set. Viewing roles requires
view_roles; creating, editing and deleting roles usemanage_roles. - Open the intended member in Team Members and use its role assignment controls. The assignment endpoints authorize updating that Admin through
update_team_members. - Choose an available role and, where supported, its project scope. The single-role assignment handler verifies membership and selected projects in the team. It rejects project-scoped
adminandbillingassignments. - Test with that ordinary administrator, in the correct team and project, including an action and project they should not access. A role's name or a visible navigation item is not the test.
The role-definition detail editor has a Role Details tab and disables autosave. Save and reload its name/permission selection explicitly, then verify the resulting effective grants with an ordinary assigned member. Editing a role definition can affect multiple assigned members; it is distinct from changing one member's assignment.
The current Team Member page exposes a role table and add/edit/remove controls. Its direct-permission table is commented out in this source snapshot; do not expect a public Add Permission control there. Direct grants remain available to supported backend/admin integration paths. Use the deployed controls and endpoint contracts rather than an old screenshot.
Which controls use which mutation path?
| Control/path | Current implementation and review boundary |
|---|---|
| Add Role | dashboard.admin-roles.store calls assignRoles after checking membership, role/team and selected project slugs. It adds assignments rather than calling sync. Additive helper behavior is checked locally; the full browser/HTTP flow still needs acceptance. |
| Edit Role Assignment | dashboard.admin-roles.update changes role_id on the bound assignment; the displayed Experience field is read-only. It does not call sync or change the assignment's project ID. The shown handler does not independently constrain that assignment to the Admin argument; verify the owned row and endpoint binding before relying on isolation. |
| Remove one role | dashboard.admin-roles.destroy passes the bound assignment ID to removeRoles and protects against removing the acting Admin's own admin role. The helper is not an ownership boundary. Removal of an explicitly selected owned assignment is checked locally; the full endpoint's denied-owner behavior is not certified. |
| Bulk Remove | dashboard.admin.roles.bulk-remove passes supplied assignment IDs to removeRoles. The current page config specifies POST while the registered route is DELETE; this control needs transport and ownership acceptance before use. |
| Role/direct-permission sync | The syncRoles/syncPermissions helper paths are separate from this page's Add/Edit/individual Remove controls. No sync action is registered on those resource routes in this snapshot. They retain the cross-project replacement limitation described below. |
For an administrator, use the intended member's Add Role flow for additive changes and inspect its resulting scope. Do not treat bulk removal or sync as a verified project-isolated procedure. For contributor code, the explicit owned-assignment selection below is the locally checked removal pattern; operator authorization and endpoint validation remain required.
Default roles are admin, billing, member, viewer and developer. Their permission sets come from config/permissions.php; custom roles can differ. Ordinary admin role permissions exclude top-level permissions. A developer role detected on any team can affect Developer Hub entry, while individual actions still need their effective permissions. This does not grant every project or provider operation.
Team and project scope
Dashboard checks use the request's current team. A team-wide assignment has no project ID; a project-specific assignment adds a project ID. For a project check, effective grants include that project's assignments and applicable team-wide grants. A project-A direct grant does not satisfy a project-B check in the current effective permission service.
Passing no project checks the team-wide effective set. It does not mean “check every project.” Assignment listings and effective permission checks are also different: getDirectPermissions() can include grants from several projects, whereas getPermissions($projectId) and hasPermissionTo(..., $projectId) apply project applicability.
Use numeric project IDs in the checks below. Several helper signatures/comments mention Project objects, but the check and sync paths pass their values into services expecting IDs. Do not rely on automatic object/name conversion for every helper.
Check permissions and roles in PHP
Inside an already-authorized application request with the intended team scope, $admin is an App\Models\Admin, $projectId is an integer, and $roleId/$permissionIds are resolved from the intended team/guard catalog:
$canView = $admin->hasPermissionTo('view_attendees', $projectId);
$canEither = $admin->hasAnyPermission(
['view_attendees', 'update_attendees'],
$projectId
);
$hasAll = $admin->hasAllPermissions($permissionIds, $projectId);
$hasRole = $admin->hasRole($roleId, $projectId);
$hasAnyRole = $admin->hasAnyRole([$roleId, $otherRoleId], $projectId);
$hasBothRoles = $admin->hasAllRoles([$roleId, $otherRoleId], $projectId);
| Helper | Current input contract |
|---|---|
hasPermissionTo | One configured permission name; an unknown name returns false |
hasAnyPermission | Permission names; succeeds when one resolved grant applies |
hasAllPermissions | Permission IDs in the current implementation; names are not converted |
hasRole, hasAnyRole, hasAllRoles | Role IDs or Role models normalized to IDs; hasRole checks all supplied roles |
assignRole | Resolves one role name, ID or Role model, then assigns it |
assignRoles | One or several role IDs |
assignPermissions, syncPermissions | Permission IDs; sync takes an array |
givePermissionTo | Permission names or Permission models resolved to IDs |
removeRoles, removePermissions | Assignment/pivot IDs, not role or permission catalog IDs |
Use a nonempty, validated required set. Do not treat empty arrays or a misspelled catalog entry as a deliberate authorization policy. The named examples must exist in the deployed permission catalog.
Laravel Gate abilities are a different interface. Use an actual model-policy ability, for example $admin->can('view', $attendee), with the request's project/team context present. A configured permission name is not automatically a Gate ability. The old $admin->can('edit_posts', ['project' => ...]) example did not establish a supported alias.
Assign grants and restore context
Resolve the target team, member, project and catalog entries through an authorized workflow before running this fragment. These low-level helpers do not authorize the operator or validate every ownership relationship.
$previousTeamId = getPermissionsTeamId();
try {
setPermissionsTeamId($teamId);
$admin->assignRoles([$roleId], $projectId);
$admin->givePermissionTo('view_attendees', $projectId);
} finally {
setPermissionsTeamId($previousTeamId);
}
Omitting the project in assignment calls creates a team-wide grant. assignRoles and assignPermissions support multiple project IDs; use only projects already verified to belong to that team. Assignment methods flush the target model's permission cache.
withTeamScope($teamId, $callback) restores the previous ID on normal return, but its current implementation has no finally. A thrown callback leaves the temporary team ID active. Use explicit restoration as above for exceptions, jobs and nested work; do not depend on it being exception-safe.
Remove a specific assignment
First authorize the operation and select an assignment belonging to the intended member, team and project. For a role assignment:
$assignmentId = $admin->roles()
->where('roles.team_id', $teamId)
->wherePivot('project_id', $projectId)
->whereKey($roleId)
->value('model_has_roles.id');
if ($assignmentId !== null) {
$admin->removeRoles((int) $assignmentId);
}
For direct permissions, use the member's permissions() relation, wherePivot('team_id', $teamId), the intended project_id and permission ID, then pass the selected model_has_permissions.id to removePermissions. For team-wide assignments, explicitly select a null project pivot. Never pass an untrusted assignment ID straight into these helpers: the removal service currently deletes the IDs supplied without constraining them to the model argument.
revokePermissionTo($names) is broader than this specific-assignment removal: its lookup is by model and permission IDs without team/project predicates. Do not use it as a project-only revoke operation.
Sync limitations
syncRoles([$roleId], $projectId) and syncPermissions([$permissionId], $projectId) are replacement operations. Current synthetic tests found that syncing project A can detach the same role/permission from project B before reattaching A. Omitting the project is not a guarantee that project-specific assignments are preserved either.
Do not use these helpers as a verified isolated update to one project. Prefer adding an intended grant or removing a validated specific assignment, inspect the complete before/after assignment set, and require a scope-preserving implementation fix before relying on sync isolation. These are local source findings; they are not a deployed HTTP acceptance result.
Dashboard Vue usage
This component belongs inside the experience-portal dashboard repository, where @/Composables/usePermissions and Inertia page props exist. It is not a standalone AppUI/ModUI or portal-plugin package export. The parent handles the emitted create intent through a server-authorized action.
<script setup>
import { usePermissions } from '@/Composables/usePermissions'
const emit = defineEmits(['create'])
const { userCan } = usePermissions()
function requestCreate() {
if (userCan('create_projects')) emit('create')
}
</script>
<template>
<section v-if="userCan('view_projects')">
<h2>Projects</h2>
<button type="button" :disabled="!userCan('create_projects')" @click="requestCreate">
Create project
</button>
</section>
</template>
The composable reads userPermissions from the current Inertia page and offers userCan, userCanAny, userCanAll, isSuperAdmin and isDeveloper. It caches the first permission map per composable instance. After changing grants or switching team/project, perform a full browser page reload in the intended context to fetch fresh props and recreate all instances, including persistent layouts. An Inertia partial reload can replace props while an existing instance keeps its earlier map.
For contributor code, recreate the component/composable that owns the permission lookup when context changes and cover persistent layouts as well. Do not assume router.reload() or refreshed props alone invalidate this helper's local cache. Empty permission names/lists are permissive in the current UI helper, so supply explicit configured names. Visibility and click checks improve the interface; they do not authorize a network request or replace server ownership/field checks.
Super admins, caching and troubleshooting
super_admin is a global direct permission, checked outside the current team. makeSuperAdmin, removeSuperAdmin and isSuperAdmin implement that special flow; production grants also validate the permitted email domain. Use only an authorized platform-administration procedure. A team admin role is different from this Gate bypass, and tests using a super admin can hide ordinary policy failures.
The permission service has a lifecycle-scoped in-memory cache and a tagged cache with configurable lifetime (default 300 seconds). Its backend must support tags; a specific Memcached/Redis deployment is not part of this helper contract. Grant/removal/service changes and Role/Permission observers handle invalidation. Direct pivot writes can bypass it, so use the service for mutations and fully reload the selected dashboard context after access changes.
For an unexpected denial, check the current team, numeric project ID, catalog name versus ID, role versus assignment ID, inherited team-wide grants, and whether the request uses a real Gate/policy ability. For unexpectedly broad access, inspect ordinary grants, global super-admin status, sync effects and the endpoint's own scope/ownership enforcement. Test another project and an ordinary administrator before changing a role to broad access.
Restricted system account administration
Global Admins and Permissions screens live on the enabled system host at /system/admins and /system/permissions. They inherit super-admin, system two-factor, authenticated/verified account, accessible-team context and password-confirmation requirements. The team-member and role permissions described above do not grant this system access. These are platform account/catalog tools, not attendee accounts, project keys or an impersonation interface.
Inspect and update an administrator
The Admins list shows Name, Email, Current Team, Last Login and Super Admin, with paginated search/sorting. Its optional team filter selects membership, not simply the current-team field. Last Login is the maximum timestamp from stored login-log rows without a success-only condition; inspect Login Logs before interpreting it as the last successful authentication.
Open the intended account by identity/ID. Details has explicit saving with autosave disabled, including identity, current team and optional new password/confirmation fields. Preserve original values, save and reload the actual account before assuming the change persisted. Changing Current Team ID does not add team membership or roles. Use the team invitation/member workflow for those operations. The current global list does not expose a create dialog; a registered provisioning endpoint is not proof of a New Admin button. Coordinate privileged provisioning through the platform team's supported process rather than inventing a UI route or sharing a temporary password in public reports.
The Super Admin field is a global direct-permission operation, not a team role. Grants also depend on the permitted email-domain policy. A submitted checkbox or successful account response is not proof the grant took effect. Verify actual global status and separately test an ordinary account's intended team/project access. Password updates have server validation and confirmation requirements; coordinate credential recovery and delivery through the private account-security procedure.
Reset MFA Settings is a separate confirmed action. The reviewed handler clears the account's two-factor confirmation timestamp; do not treat its success message as evidence that every secret, recovery code, login session or token was revoked. Confirm the intended reenrollment and recovery outcome with the platform team. Likewise, account deletion is a separate lifecycle action; the handler skips self-deletion and returns afterward, so a redirect alone does not prove a record was removed. Review ownership, service dependencies and active credentials before retirement, then verify the actual account/access state through supported private controls.
Teams, roles and login logs
The account detail page has Teams, Roles and Login Logs tabs. The Teams row's navigation action switches the acting administrator's dashboard team context; it does not sign in as the inspected person or grant that person membership. Keep the acting identity and inspected account separate.
Roles lists assignment rows with Role, Team, Experience and permission count. All Experiences denotes a null project scope on that assignment, not access to all teams. Counts describe permissions attached to that role; they do not include every direct grant, global override or effective policy result. The expandable permission detail is commented out in this UI, so do not rely on a hidden expansion control to establish effective access. Use the owning team's role/member tools and an ordinary-account check for actual grants.
Login Logs is a paginated, account-scoped table of time, IP address, login type and a success indicator derived from the failure flag. Search matches stored type/IP. It is recorded evidence, not a full session/token inventory, proof of current access or an incident-resolution action. Missing rows do not establish that no authentication-related event occurred. Preserve account/log IDs, time/timezone and the observed success/failure when escalating; keep IPs, identity and security details out of public feedback. Detailed investigation and session revocation belong in private procedures.
System permission catalog
The system Permissions list shows a friendly Name, technical Slug and guard-group identifier (GGN). Search/sorting use the stored permission name. The admin catalog query excludes the special super_admin row, so its absence is not proof no global administrator exists. Catalog presence does not assign a grant to anyone or implement a policy in application code.
Open a permission's Details to inspect its technical identity. The shared Name field is read-only and detail autosave is disabled; the backend update route does not make arbitrary renaming a supported UI workflow. Coordinate configured permission changes with the platform team because roles, code checks and integrations depend on those identities. Creating a catalog row alone does not make a new module or endpoint enforce it. Deleting/renaming a configured permission is not a verified way to revoke one person's access.
Generate permissions from configuration
Generate Permissions From Config queues a guarded administrative action; the notification says generation started, not completed. The action creates missing configured permission names and adds default-role permission relationships for the admin guard group, then flushes its permission cache. It does not remove extra catalog rows or existing role grants. Treat it as an additive reconciliation, not a reset to an exact least-privilege state or a single-team role repair.
Before requesting it, review intended configuration and the affected default-role names with the platform team. After completion, reload the catalog and relevant roles, compare actual grants and test allowed/denied actions in the intended team/project with an ordinary administrator. Queue acceptance, a friendly label or a role's name does not establish those results. Do not repeatedly generate to diagnose a delayed queue or remove unexpected access.
Verify and recover system access changes
Record the acting and target account, team/project, role or assignment IDs, technical permission names, prior values and actual response/error. For 403 or missing system controls, verify system authority and two-factor/password state rather than broadening ordinary project roles. For stale access, reload context and compare effective permissions, not just displayed catalog/assignment counts. For an uncertain account/MFA/grant operation, inspect persisted state before retrying and coordinate the private recovery procedure. Preserve a working authorized administrator and confirm the intended access boundaries before retiring credentials or changing global authority.
Implementation evidence
Reviewed on 2026-10-13 against experience-portal a010092b9c: HasRolesAndPermissions, PermissionsService, permission helpers, Admin, Role, Permission, assignment models, BaseDashboardPolicy, AuthServiceProvider, Role/Permission observers, role/member assignment controllers and the Team Member page. Synthetic fixture results and source hashes are retained in the repository's authentication audit. Browser/admin endpoint acceptance remains separate.
System account/catalog guidance was supplemented on 2026-10-15 against platform 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093, including system controllers/requests, AdminsService, permission generation and current detail/list UI. This supplements the earlier helper review; it does not renew its runtime results or establish deployed account/security acceptance.