Permissions Guideο
Overviewο
LUStores implements a comprehensive permission system that provides fine-grained control over user access to features and operations. This guide documents all 45+ permissions, their functions, and how to manage them effectively.
Key Concepts:
π Role-Based Access: Three built-in roles (User, Superuser, Admin)
π Fine-Grained Permissions: 45+ individual permissions
π Permission Inheritance: Permissions cascade from roles
β‘ Explicit Grants: Override role defaults for specific users
π‘οΈ Least Privilege: Grant minimum permissions needed
Role Hierarchyο
LUStores has three built-in user roles with increasing privilege levels:
User (Basic Access)ο
Purpose: Standard users who perform daily operations
Default Permissions: - View inventory, sales, and orders - Create sales and quotes - Update stock levels - View reports (limited)
Typical Users: - Laboratory staff - Warehouse workers - Sales counter staff - Department assistants
Cannot Do: - Modify system settings - Manage other users - Delete records permanently - Access backups or migrations
Superuser (Advanced Access)ο
Purpose: Department managers and power users
Default Permissions: - All User permissions - Create and edit items - Manage suppliers - Create and receive orders - Access detailed reports - Manage categories - Assign charge codes
Typical Users: - Department managers - Procurement officers - Lab managers - Finance coordinators
Cannot Do: - Manage user accounts - Modify system-level settings - Create backups - Perform database migrations - Reset user passwords
Admin (Full Access)ο
Purpose: System administrators with full control
Default Permissions: - All Superuser permissions - Manage users (create, edit, delete) - Reset user passwords - Modify system settings - Create and restore backups - Access all administrative functions - Manage permissions
Typical Users: - IT administrators - System administrators - Technical staff
Responsibility: - System security - User management - Backup procedures - Disaster recovery
Permission Inheritanceο
Permissions cascade from roles:
Admin (All 45+ Permissions)
βββ Superuser (~35 Permissions)
βββ User (~20 Permissions)
Example:
User has
inventory.viewSuperuser inherits
inventory.view+ gainsinventory.editAdmin inherits both + gains
inventory.delete
Permission Categoriesο
Permissions are organized into 9 functional categories:
Inventory Permissionsο
Control access to inventory management features.
Permission |
Description |
|---|---|
|
View inventory items |
|
Create new items |
|
Modify existing items |
|
Delete items (with safety checks) |
|
Adjust stock levels |
|
Perform bulk operations |
|
Export inventory data |
Use Cases:
View only: Warehouse staff browsing inventory
Add/Edit: Procurement creating new items
Delete: Admins cleaning up discontinued items
Manage stock: Staff adjusting quantities after counts
Bulk edit: Managers updating VAT rates for categories
Sales Permissionsο
Control access to sales and quote features.
Permission |
Description |
|---|---|
|
View sales transactions |
|
Create new sales |
|
Process quotes into sales |
|
Issue refunds |
|
Mark sales as paid/unpaid |
|
Export sales data |
Use Cases:
View: Finance reviewing transaction history
Create: Counter staff processing customer purchases
Process: Converting approved quotes to sales
Refund: Managers handling returns
Mark paid: Accounting reconciling payments
Export: Finance generating monthly reports
Quote Permissionsο
Control access to quote/draft management.
Permission |
Description |
|---|---|
|
View quotes |
|
Create draft quotes |
|
Modify quotes |
|
Delete draft quotes |
|
Convert quotes to sales |
Use Cases:
Create: Staff building quotes for customers
Edit: Modifying quotes before approval
Delete: Removing abandoned drafts
Process: Completing approved quotes
Orders Permissionsο
Control access to purchase order features.
Permission |
Description |
|---|---|
|
View purchase orders |
|
Create new orders |
|
Modify pending orders |
|
Mark orders as received |
|
Delete orders (safety checks) |
|
Upload invoice PDFs |
Use Cases:
View: Staff checking order status
Create: Procurement placing orders
Receive: Warehouse marking deliveries
Upload invoice: Finance attaching invoices
Suppliers Permissionsο
Control access to vendor/supplier management.
Permission |
Description |
|---|---|
|
View supplier information |
|
Create new suppliers |
|
Modify supplier details |
|
Delete suppliers |
|
Full supplier management (all above) |
Use Cases:
View: Staff checking supplier contacts
Manage: Procurement maintaining vendor database
Categories Permissionsο
Control access to item categorization.
Permission |
Description |
|---|---|
|
View categories |
|
Create new categories |
|
Modify categories |
|
Delete categories |
Use Cases:
View: All users browsing categories
Add/Edit: Admins organizing inventory structure
Delete: Admins removing unused categories
Users & Permissionsο
Control access to user account management.
Use Cases:
View: Admins reviewing user list
Add: Admins onboarding new staff
Reset password: Help desk resetting forgotten passwords
Manage permissions: Admins customizing access
Assign chargecode: Managers authorizing budget access
Reports Permissionsο
Control access to reporting features.
Permission |
Description |
|---|---|
|
View reports page |
|
Generate custom reports |
|
Export reports to Excel/CSV |
|
View financial reports (sales totals) |
Use Cases:
View: Staff checking basic reports
Generate: Managers creating custom reports
Export: Finance exporting for external analysis
Financial: Finance viewing sensitive financial data
Settings Permissionsο
Control access to system configuration.
Permission |
Description |
|---|---|
|
View settings page |
|
Modify system settings |
|
Configure VAT rates |
|
Manage user permissions |
Use Cases:
View: Admins checking configuration
Edit: Admins modifying settings
Manage VAT: Finance configuring tax rates
Permissions: Admins controlling access
Backup & Systemο
Control access to critical system operations.
Permission |
Description |
|---|---|
|
View backup list |
|
Create database backups |
|
Restore from backups |
|
Download backup files |
|
Access system management features |
|
Run database migrations |
Use Cases:
View: Admins checking backup status
Create: Automated backup schedules
Restore: Emergency disaster recovery
Migration: Upgrading database schema
Managing Permissionsο
Viewing User Permissionsο
Navigate to Settings > Permissions tab
User list displays all accounts
Click userβs row to expand permissions
Green checkmarks indicate granted permissions
Gray checkmarks indicate inherited (role-based) permissions
Empty boxes indicate denied permissions
Permission Indicators:
β Green Checkmark: Explicitly granted
βοΈ Gray Checkmark: Inherited from role
β¬ Empty Box: Not granted
Granting a Permissionο
Step-by-Step:
Navigate to Settings > Permissions
Find user in list
Click Manage Permissions button
Locate the permission to grant
Toggle switch to ON (green)
Click Save Changes
Success toast confirms update
Example:
Grant reports.export to user βjane.smithβ:
Settings > Permissions
Find βjane.smith@example.comβ
Manage Permissions
Find βReportsβ section
Toggle
reports.exportto ONSave
Result: Jane can now export reports to Excel/CSV
Revoking a Permissionο
Step-by-Step:
Navigate to Settings > Permissions
Find user in list
Click Manage Permissions
Locate the permission to revoke
Toggle switch to OFF (gray)
Click Save Changes
Confirmation dialog may appear for critical permissions
Confirm revocation
Warning: Revoking core permissions may prevent user from performing their job. Consider carefully before revoking.
Bulk Permission Changesο
To grant the same permission to multiple users:
Option 1: Use Role System
Ensure users have correct role (User/Superuser/Admin)
Role grants default permissions automatically
Option 2: Manual Grant (for exceptions)
Grant permission to first user
Note permission name
Repeat for other users
Note
Thereβs no bulk grant UI currently. Consider using roles for groups of users with similar needs.
Permission Best Practicesο
Least Privilege Principleο
Definition: Users should have the minimum permissions required to perform their job.
Benefits:
β Improved security (limits damage from compromised accounts)
β Reduced errors (users canβt accidentally break things)
β Clear responsibilities (permissions define roles)
β Audit trail (permission changes are logged)
Example:
β Bad: Grant all permissions to all users βjust in caseβ
β Good: Grant specific permissions based on job function
Counter Staff:
- inventory.view
- sales.create
- sales.view
- quotes.create
Warehouse Staff:
- inventory.view
- inventory.manage_stock
- orders.view
- orders.receive
Role-Based Assignmentο
Start with Roles:
Determine userβs primary job function
Assign appropriate role (User/Superuser/Admin)
Role grants base permissions automatically
Customize with Explicit Grants:
Identify gaps (permissions user needs but role doesnβt grant)
Grant specific additional permissions
Document why user has custom permissions
Example:
Base Role: User
Additional Grants:
- orders.create (user manages ordering for their lab)
- reports.financial (user tracks departmental spending)
Reason: User is lab manager but not full Superuser
Regular Permission Auditsο
Quarterly Review:
Review all user accounts
Verify users still need assigned permissions
Remove permissions for changed roles
Deactivate accounts for departed users
What to Check:
β Users with custom permissions (not just role defaults)
β Admin accounts (are all still active admins?)
β Recently modified permissions
β Inactive accounts (last login > 90 days)
Documentationο
Maintain a Permission Matrix:
Create a document mapping job titles to required permissions:
Job Title: Laboratory Assistant
Required Permissions:
- inventory.view
- sales.create
- quotes.create
- orders.view
Job Title: Lab Manager
Required Permissions:
- Superuser role (default permissions)
- Additional: backup.view, reports.financial
Benefits:
Consistent onboarding
Quick reference for help desk
Audit documentation
Common Permission Scenariosο
Scenario 1: New Employeeο
Situation: Onboarding a new warehouse worker
Steps:
Create user account with User role
Base permissions from role:
inventory.view
sales.view
orders.view
Grant additional permissions:
inventory.manage_stock (for stock adjustments)
orders.receive (for marking deliveries)
Test: Log in as user, verify access
Scenario 2: Promotionο
Situation: User promoted to department manager
Steps:
Change role from User to Superuser
User inherits expanded permissions
Grant additional if needed:
users.assign_chargecode (for budget management)
reports.financial (for financial oversight)
Remove custom User-level grants (no longer needed)
Notify user of new capabilities
Scenario 3: Temporary Accessο
Situation: User needs temporary backup access during disaster recovery
Steps:
Grant
backup.restorepermissionDocument reason: βDR Exercise 2025-01-15β
Notify security team
After emergency:
Revoke
backup.restoreAdd note to audit log
Review logs for actions taken
Scenario 4: Department Reorganizationο
Situation: Merging two departments, consolidating charge codes
Steps:
Review all users in both departments
Identify who needs
users.assign_chargecodeStandardize permissions across merged department
Update permission matrix documentation
Train users on new charge code structure
Testing Permissionsο
Test User Accountsο
Create test accounts for each role:
test-user@example.com (Role: User)
test-superuser@example.com (Role: Superuser)
test-admin@example.com (Role: Admin)
Use for:
Testing permission changes before applying to real users
Training new admins
Verifying feature access
Testing Workflowο
Make permission change on test account
Log in as test user (incognito browser)
Test feature access:
Can user access the feature?
Does βPermission Deniedβ appear when expected?
Are UI elements hidden/shown correctly?
Verify behavior matches expectations
Apply to production users
Troubleshootingο
Common Issuesο
User Canβt Access Feature
Check:
β User has correct role
β Required permission is granted
β User logged out and back in (permissions cache)
β Feature isnβt disabled in settings
β Browser cache cleared
Solution:
Grant missing permission
Have user refresh browser (Ctrl+Shift+R)
Check server logs for permission errors
Permission Changes Donβt Apply
Check:
β Changes were saved (success toast appeared)
β User logged out and back in
β Correct user was modified
β Database connection working
Solution:
Log out all users (force token refresh)
Check database permissions table
Verify no caching issues
User Has Too Much Access
Check:
β Userβs role (Admin has all permissions)
β Explicit grants (custom permissions)
β Group memberships (future feature)
Solution:
Review userβs explicit grants
Downgrade role if too high
Audit recent permission changes
Security Considerationsο
Admin Account Securityο
Best Practices:
β Limit number of admin accounts
β Use strong, unique passwords
β Enable 2FA (when available)
β Review admin activity logs regularly
β Deactivate unused admin accounts
Recommendation: Maximum 3-5 admin accounts per institution
Critical Permissionsο
High-Risk Permissions:
backup.restore- Can overwrite databaseusers.delete- Can remove user accountsmigration.execute- Can modify schemasettings.edit- Can change system behavior
Protection:
Grant only to trusted admins
Require approval for grants
Log all uses
Review regularly
Complianceο
GDPR Considerations:
Limit
reports.financialto necessary staffAudit user access to personal data
Document permission grants for compliance
Audit Trail:
All permission changes are logged
Review logs for suspicious activity
Export logs for compliance reporting
Summaryο
The LUStores permission system provides comprehensive access control:
β 45+ permissions organized into 9 categories β Three-tier role system (User, Superuser, Admin) β Permission inheritance from roles β Explicit grants for customization β Least privilege security model β Audit logging for compliance
Key Takeaways:
Start with roles, customize with explicit grants
Follow least privilege principle
Conduct regular permission audits
Document custom permission patterns
Test permission changes thoroughly
Protect critical system permissions
For permission management workflows, see Settings Guide Tab 5: Permissions.