This document provides a comprehensive overview of the Roles Management page within the BabeRuka/systemroles
Laravel package. This package is designed to streamline user role and permission management in Laravel applications.
Overview of the Roles Management Page (/systemroles/admin/roles
)
The Roles Management page provides a centralized interface for viewing, adding, and editing user roles within your application.
Key Features:
-
All Roles Table: This table displays a list of all defined roles with the following columns:
- #: Role ID or sequential number.
- Role Name: The human-readable name of the role (e.g., “Super Admin”).
- Guard: The guard associated with the role (e.g., “super_admin”).
- # of Users: The number of users currently assigned to this role.
- Permissions: A summary of permissions granted to the role (e.g., “View”, “Update”).
- Sequence: The display order or sequence of the role.
- Action: Actions that can be performed on the role, including:
- Manage Permissions: A link to manage permissions for the specific role (e.g.,
https://app.systemroles.com/systemroles/admin/roles/manage?role_id=1
). - Edit Role: A button to open the “Edit Role” modal.
- Manage Permissions: A link to manage permissions for the specific role (e.g.,
-
Add Role Button: A “Add Role” button (
<i class="fa fa-plus"></i> Add Role
) is available to create new roles. Clicking this button opens the “Add Role” modal.
Modals:
-
Add Role Modal (
#AddRoleModal
):- Title: “Add Role”
- Fields:
- Role Name: Text input for the role’s name.
- Guard Name: Text input for the role’s guard.
- Sequence: Number input for the role’s sequence.
- Description: Textarea for a detailed description of the role.
- Action: “Save Role” button to submit the new role.
- Endpoint:
https://app.systemroles.com/systemroles/admin/roles/store
(POST request).
-
Edit Role Modal (
#EditRoleModal
):- Title: “Edit Role”
- Fields:
- Role Name: Text input for the role’s name (pre-filled with existing data).
- Guard Name: Text input for the role’s guard (read-only and disabled).
- Sequence: Number input for the role’s sequence (pre-filled with existing data).
- Description: Textarea for a detailed description of the role (pre-filled with existing data).
- Action: “Update Role” button to save changes to the role.
- Endpoint:
https://app.systemroles.com/systemroles/admin/roles/update
(POST request with_method
as POST). - Hidden Field:
role_id
(value pre-filled with the role’s ID).