Skip to main content

Roles & Permissions (RBAC)

The HRMS uses Spatie Laravel Permission for role-based access control. The backend is the source of truth for all authorization decisions.

Roles

RoleDescription
AdminFull system access. Can manage RBAC, entities, departments, and all employees.
HRFull Module-1 access plus KPI template/cycle management and KPI workflow admin actions.
ManagerRead-only access to departments. Can view all employees. Reviews assigned KPI evaluations and probation reviews.
TeamLeadRead-only access to departments. Can view employees in their led departments. Reviews assigned evaluations.
EmployeeCan view own employee record only. Submits own self-evaluations.

Permission Matrix

PermissionAdminHRManagerTeamLeadEmployee
entities.view
entities.create
entities.update
entities.delete
departments.view
departments.create
departments.update
departments.assign_managers
departments.assign_team_leads
employees.view
employees.view_all
employees.create
employees.update
employees.deactivate
rbac.manage
kpi-template.view
kpi-template.create
kpi-template.update
kpi-template.delete
kpi-cycle.view
kpi-cycle.create
kpi-cycle.update
kpi-cycle.delete
kpi-cycle.publish
kpi-evaluation.view
kpi-evaluation.update
kpi-evaluation.review
kpi-evaluation.assign-reviewer
kpi-evaluation.force-close

How RBAC Is Enforced

Backend (Source of Truth)

  1. Policies — Each controller action checks authorization via Laravel Policies using $user->can('permission.name').
  2. FormRequest authorize() — Mutation requests include permission checks in the request class.
  3. Team-scoped access — Managers see employees in their managed departments; TeamLeads see employees in their led departments.

Frontend (UI-Level)

  1. GET /api/me returns the user's roles and permissions array.
  2. The AuthProvider context exposes can() and hasRole() helpers.
  3. Sidebar menu items are conditionally shown/hidden based on permissions.
  4. Action buttons (create, edit, delete) are hidden when the user lacks the required permission.
note

The frontend permission checks are for UI convenience only. All actual authorization is enforced by the backend. Removing a button from the UI does not bypass the server-side check.

Employee Visibility Rules

RoleWhat They See
Admin / HRAll employees across all entities
ManagerAll employees (read-only)
TeamLeadEmployees in departments where they are a team lead, plus their own record
EmployeeTheir own record only

KPI Evaluation Visibility

RoleScope
Admin / HRAll evaluations across all cycles
ManagerEvaluations assigned to them as reviewer (within their managed departments)
TeamLeadEvaluations assigned to them as reviewer (within their led departments)
EmployeeOnly their own evaluations