Appearance
Roles & Permissions
This guide explains the role-based access control (RBAC) system, how to create and manage roles, assign permissions, and best practices for access control.
Table of Contents
- Overview
- Understanding Roles
- Understanding Permissions
- Default Roles
- Creating Custom Roles
- Assigning Permissions
- Managing Users and Roles
- Permission Structure
- Best Practices
Overview
What is RBAC?
Role-Based Access Control (RBAC) is a security system that restricts access based on user roles and permissions. Users are assigned roles, and roles are assigned permissions.
How It Works
Hierarchy:
- Users are assigned Roles
- Roles are assigned Permissions
- Permissions control access to features
Benefits
- ✅ Centralized access control
- ✅ Easy to manage
- ✅ Scalable
- ✅ Secure
- ✅ Flexible
Understanding Roles
What are Roles?
Roles are collections of permissions that define what users can do in the system. Instead of assigning permissions to each user individually, you assign roles.
Role Characteristics
Properties:
- Name: Unique identifier
- Description: What the role is for
- Permissions: What the role can do
- Users: Who has this role
Role Types
System Roles
Characteristics:
- Pre-defined by system
- Cannot be deleted
- Core functionality
- Examples: super-admin, admin
Custom Roles
Characteristics:
- Created by administrators
- Can be deleted
- Custom permissions
- Flexible configuration
Understanding Permissions
What are Permissions?
Permissions are specific actions that can be performed in the system. They control access to features, modules, and functions.
Permission Format
Structure:
{action} {resource}Examples:
view posts- Can view blog postscreate products- Can create productsedit users- Can edit usersdelete tickets- Can delete tickets
Permission Types
Module Permissions
Standard Actions:
- view: View content
- create: Create new content
- edit: Edit existing content
- delete: Delete content
- manage: Full control
Examples:
view postscreate postsedit postsdelete postsmanage posts
System Permissions
Core Permissions:
access admin panel- Access admin areamanage settings- Change settingsmanage roles- Manage roles and permissionsmanage users- User managementmanage media- Media library access
Special Permissions
Module-Specific:
reply tickets- Reply to support ticketsedit own courses- Edit own courses onlyview own tickets- View own tickets onlyassign tasks- Assign tasks to users
Default Roles
Super Admin
Description:
- Full system access
- All permissions
- Cannot be restricted
- System administrator
Permissions:
- All permissions (via Gate)
- Cannot be limited
- Full control
Use For:
- System administrators
- Developers
- Full access needed
Admin
Description:
- Administrative access
- Most permissions
- Can manage users
- Can change settings
Permissions:
access admin panelmanage settingsview userscreate usersedit usersdelete usersassign rolesmanage media- Task management permissions
- Most module permissions
Use For:
- Administrators
- Managers
- Full management access
Instructor
Description:
- Course creation and management
- Limited admin access
- Focus on courses
Permissions:
access admin panelview coursescreate coursesedit coursesedit own coursesdelete own courses- Course-related permissions
Use For:
- Course instructors
- Teachers
- Content creators
Editor
Description:
- Content creation and editing
- Limited admin access
- Content focus
Permissions:
access admin panelview postscreate postsedit posts- Content-related permissions
Use For:
- Content editors
- Writers
- Blog managers
Support Specialist
Description:
- Ticket management
- Customer support
- Limited admin access
Permissions:
access admin panelview ticketsreply ticketsview own tickets- Ticket-related permissions
Use For:
- Support staff
- Customer service
- Help desk
Student
Description:
- Regular user
- No admin access
- Frontend only
Permissions:
- Frontend access only
- No admin permissions
- Basic user permissions
Use For:
- Regular users
- Customers
- Students
Creating Custom Roles
Step 1: Access Roles
- Navigate to Roles:
- Go to Users → Roles
- Or navigate to:
/admin/roles
Step 2: Create New Role
- Click Create:
- Click Create New Role button
- Role creation form appears
Step 3: Configure Role
Basic Information:
- Name: Role name (required, unique)
- Description: Role description (optional)
- Color: Role color (optional)
- Priority: Display priority (optional)
Settings:
- Active: Enable/disable role
- System Role: Mark as system role (cannot be deleted)
Step 4: Assign Permissions
Select Permissions:
- Browse permission groups
- Check permissions to grant
- Uncheck to exclude
Permission Groups:
- Core: System permissions
- Users: User management
- Content: Content modules
- E-Commerce: E-commerce modules
- Learning: Course modules
- Support: Support modules
- Business: Business modules
- Productivity: Task management
Step 5: Save Role
Review:
- Verify role name
- Check permissions
- Review settings
Save:
- Click Save or Create
- Role created
- Available for assignment
Assigning Permissions
To Roles
Method 1: During Creation
- Create Role:
- Create new role
- Select permissions
- Save role
Method 2: Edit Existing Role
Edit Role:
- Go to Roles → Edit
- Find role to edit
- Click Edit
Modify Permissions:
- Check/uncheck permissions
- Add new permissions
- Remove permissions
Save:
- Click Update
- Permissions updated
- Applied to all users with role
To Users
Direct Permission Assignment
Edit User:
- Go to Users → Edit
- Find user
- Click Edit
Assign Permissions:
- Go to Permissions section
- Check permissions to grant
- User-specific permissions
Save:
- Click Update
- Permissions assigned
- Override role permissions
Managing Users and Roles
Assigning Roles to Users
Single User
Edit User:
- Go to Users → Edit
- Find user
- Click Edit
Assign Role:
- Go to Roles section
- Select role(s)
- User can have multiple roles
Save:
- Click Update
- Role assigned
- Permissions updated
Bulk Assignment
Select Users:
- Go to Users list
- Select multiple users
- Use checkboxes
Bulk Action:
- Click Bulk Actions
- Select Assign Role
- Choose role
Apply:
- Click Apply
- All selected users get role
- Permissions updated
Removing Roles
Edit User:
- Go to Users → Edit
- Find user
- Click Edit
Remove Role:
- Go to Roles section
- Uncheck role
- User loses role permissions
Save:
- Click Update
- Role removed
- Permissions updated
Permission Structure
Permission Naming Convention
Format:
{action} {resource}Actions:
view- View contentcreate- Create contentedit- Edit contentdelete- Delete contentmanage- Full control
Resources:
- Module names (posts, products, etc.)
- System resources (users, settings, etc.)
Permission Groups
Core Permissions
access admin panelmanage settingsmanage rolesmanage usersmanage media
Module Permissions
Content Modules:
view posts,create posts,edit posts,delete postsview testimonials,create testimonials, etc.view faqs,create faqs, etc.view kb,create kb, etc.
E-Commerce Modules:
view products,create products, etc.view pricing-plans,create pricing-plans, etc.view services,create services, etc.
Learning Modules:
view courses,create courses, etc.
Project Modules:
view projects,create projects, etc.view case-studies,create case-studies, etc.view events,create events, etc.
Support Modules:
view tickets,create tickets, etc.reply ticketsview own tickets
Business Modules:
view quotes,create quotes, etc.view causes,create causes, etc.view appointments,create appointments, etc.view jobs,create jobs, etc.
Productivity Modules:
view tasks,create tasks, etc.assign tasksview own tasksmanage projects
Best Practices
Role Design
Principle of Least Privilege:
- Grant minimum necessary permissions
- Only what's needed
- Review regularly
Role Clarity:
- Clear role names
- Descriptive descriptions
- Document purpose
Avoid Overlap:
- Distinct roles
- Clear boundaries
- Avoid confusion
Permission Management
Regular Review:
- Review permissions regularly
- Remove unused permissions
- Update as needed
Documentation:
- Document custom roles
- Note permission purposes
- Keep records
Testing:
- Test role permissions
- Verify access control
- Check restrictions
User Management
Assign Appropriate Roles:
- Match role to user needs
- Don't over-permission
- Review assignments
Monitor Access:
- Monitor user access
- Review activity
- Audit permissions
Remove Access Promptly:
- Remove when no longer needed
- Deactivate users
- Revoke permissions
Troubleshooting
User Cannot Access Feature
Solutions:
- Check user's role
- Verify role has permission
- Check user-specific permissions
- Verify module is enabled
- Clear cache
Permission Not Working
Solutions:
- Verify permission exists
- Check permission assigned to role
- Verify user has role
- Check for conflicts
- Review policies
Role Not Appearing
Solutions:
- Check role is active
- Verify role exists
- Check permissions
- Clear cache
- Refresh page
Related Documentation
Last Updated: [Date will be updated during final review]