2402 Roles And Permissions
Roles and Permissions
Introduction
What Are Roles?
Role Examples
Typical roles in different applications:
CRM Application
- Admin - Full system access
- Sales Manager - View all leads, manage sales team
- Sales Rep - View and edit own leads
- Support - View customer data, limited editing
Project Management App
- Admin - Full access
- Project Manager - Manage assigned projects
- Team Member - View projects, edit own tasks
- Client - View own projects only
HR System
- HR Admin - Full employee data access
- Manager - View team data, approve requests
- Employee - View/edit own information
Benefits of Roles
- Simplified Management - Set permissions once per role, not per user
- Consistency - All users with the same role have identical permissions
- Scalability - Easy to add new users with appropriate access
- Maintainability - Change role permissions to affect all users in that role
- Clarity - Clear definition of who can do what
Creating Roles
How to Create a Role
- Go to Settings → Roles
- Click "Add Role"
- Enter a Role Name (e.g., "Manager", "Customer", "Employee")
- Optionally add a Description (helps document the role's purpose)
- Click "Create"
Role Naming Best Practices
- Use clear, descriptive names (avoid abbreviations)
- Use titles or job functions (Manager, Sales Rep, Customer)
- Be consistent with naming conventions
- Consider hierarchy (Admin, Manager, Employee)
- Avoid technical jargon (unless appropriate for your users)
Default Role
You can designate a role as the Default Role:
- New users are automatically assigned this role when they sign up
- Useful for self-registration scenarios
- Typically set to the lowest privilege role (e.g., "Customer" or "Guest")
- Can be changed later by administrators
To set default role:
- Go to Settings → Roles
- Click on a role
- Check "Default Role for New Signups"
- Save
Page-Level Permissions
How Page Permissions Work
For each page in your app, you specify which roles can access it:
- If a role has permission, users in that role can view the page
- If a role doesn't have permission, the page doesn't appear in navigation and cannot be accessed directly
- You can assign multiple roles to each page
Setting Page Permissions
Method 1: From Page Settings
- Go to Page Builder
- Select a page
- Click Page Settings (gear icon)
- Go to Permissions tab
- Check the boxes for roles that should access this page
- Save
Method 2: From Roles Settings
- Go to Settings → Roles
- Select a role
- Click Page Permissions
- Check the boxes for pages this role should access
- Save
Public Pages
Public pages can be accessed without logging in:
- In Page Settings → Permissions
- Check "Public Page"
- Page is now accessible to anyone
- Useful for login, signup, contact forms, marketing pages
Page Permission Examples
Example 1: Basic App Structure
| Page Name | Admin | Manager | Employee | Public |
|---|---|---|---|---|
| Login | - | - | - | ✓ |
| Signup | - | - | - | ✓ |
| Dashboard | ✓ | ✓ | ✓ | - |
| All Projects | ✓ | ✓ | - | - |
| My Projects | ✓ | ✓ | ✓ | - |
| User Management | ✓ | - | - | - |
| Reports | ✓ | ✓ | - | - |
| Settings | ✓ | - | - | - |
Example 2: Customer Portal
| Page Name | Admin | Staff | Customer | Public |
|---|---|---|---|---|
| Login | - | - | - | ✓ |
| All Orders | ✓ | ✓ | - | - |
| My Orders | ✓ | - | ✓ | - |
| All Customers | ✓ | ✓ | - | - |
| My Account | ✓ | - | ✓ | - |
| Submit Order | ✓ | - | ✓ | - |
| Admin Dashboard | ✓ | - | - | - |
Default Landing Pages
You can set different landing pages for different roles:
- Go to Settings → Roles
- Select a role
- Set "Default Page After Login"
- Save
Example:
- Admin → Admin Dashboard
- Manager → Team Dashboard
- Employee → My Tasks
- Customer → My Orders
Component-Level Permissions
Why Use Component Permissions?
Multiple roles might access the same page but see different things:
- Admin sees all data; Manager sees team data; Employee sees own data
- Different charts/reports for different roles
- Show action buttons only to appropriate roles
- Conditional functionality based on role
Setting Component Permissions
- Go to Page Builder and select a page
- Click on a component
- Go to Settings (or Display Rules depending on component)
- Find "Roles That Can View This Component"
- Select applicable roles
- Save
If no roles are selected, the component is visible to all roles that can access the page.
Component Permission Examples
Example 1: Dashboard with Role-Specific Widgets
Create one "Dashboard" page, but show different components to different roles:
- Sales Chart - Visible to: Admin, Sales Manager
- My Sales - Visible to: Admin, Sales Manager, Sales Rep
- Revenue Report - Visible to: Admin only
- My Tasks - Visible to: All roles
- User Management Button - Visible to: Admin only
Example 2: Project Details Page
Different action buttons based on role:
- Edit Project Button - Visible to: Admin, Project Manager
- Delete Project Button - Visible to: Admin only
- Add Comment Button - Visible to: All roles
- Assign Tasks Button - Visible to: Admin, Project Manager
- Financial Tab - Visible to: Admin, Finance
Example 3: Data Table with Different Views
Show different columns based on role:
- Create multiple table components on the same page
- Full Table (all columns) - Visible to: Admin
- Manager Table (most columns) - Visible to: Manager
- Employee Table (limited columns) - Visible to: Employee
Field-Level Permissions
How Field Permissions Work
For each field in a form or details component, you can set:
- Visible to which roles - Which roles can see the field
- Editable by which roles - Which roles can modify the field
- Required for which roles - Which roles must fill in the field
Setting Field Permissions
In Form Components
- Add or edit a Form Component
- Click on a field in the form
- In field settings, find "Field Permissions"
- Configure visibility and editability by role
- Save
In Details Components
- Add or edit a Details Component
- Click on a field in the details layout
- Configure which roles can see the field
- Save
Field Permission Options
| Setting | Description | Use Case |
|---|---|---|
| Visible | Field is displayed | Show salary to HR and Admin only |
| Hidden | Field is not displayed | Hide sensitive fields from certain roles |
| Editable | Field can be modified | Allow managers to edit status |
| Read-Only | Field is visible but not editable | Show price to customers but they can't change it |
| Required | Field must be filled in | Managers must provide approval notes |
Field Permission Examples
Example 1: Employee Record Form
| Field | Admin | Manager | Employee |
|---|---|---|---|
| Name | Edit | View | Edit |
| Edit | View | Edit | |
| Phone | Edit | View | Edit |
| Department | Edit | Edit | View |
| Salary | Edit | Hidden | Hidden |
| Performance Rating | Edit | Edit | View |
| Social Security # | Edit | Hidden | Hidden |
Example 2: Order Form
| Field | Admin | Sales | Customer |
|---|---|---|---|
| Product | Edit | Edit | Edit |
| Quantity | Edit | Edit | Edit |
| Price | Edit | Edit | View |
| Discount | Edit | Edit | Hidden |
| Cost | View | Hidden | Hidden |
| Status | Edit | Edit | View |
| Internal Notes | Edit | Edit | Hidden |
Example 3: Approval Workflow
| Field | Admin | Manager | Employee |
|---|---|---|---|
| Request Type | View | View | Edit |
| Description | View | View | Edit |
| Amount | View | View | Edit |
| Approval Status | Edit | Edit | View |
| Approval Notes | Edit | Edit (Required) | View |
| Approved By | View | View | View |
Action Link Permissions
Data Permissions
Filtering Data by Role
Use filters in components to show different data to different roles.
Example: Sales Dashboard
- Admin - Sees all sales (no filter)
- Manager - Sees sales for their region (filter: Region = Manager's Region)
- Sales Rep - Sees only their own sales (filter: Salesperson = Logged In User)
Implementation Approaches
Approach 1: Multiple Components
- Create separate table components for each role
- Set role visibility on each component
- Apply appropriate filters
Approach 2: Dynamic Filters with Conditional Logic
- Use a single component
- Create page criteria that vary by role
- Apply conditional filters based on logged-in user
Approach 3: Owner-Based Filtering (covered in detail in Article 6)
- Use connection fields to link records to users
- Filter: "Owner" = "Logged In User"
- Automatically shows users only their records
Role Hierarchy
Conceptual Hierarchy
Think of roles as layers of access:
- Admin - Full access to everything
- Manager - Access to most things, limited admin functions
- Employee - Access to work-related pages, own data
- Customer - Access to customer portal, own orders
- Guest - Very limited access, public pages only
Implementing Hierarchical Permissions
When setting permissions:
- Higher-level roles get all permissions of lower-level roles, plus more
- Admin role should always have access to everything
- Each level down has progressively fewer permissions
Example Permission Matrix
| Feature | Admin | Manager | Employee | Customer |
|---|---|---|---|---|
| View Dashboard | ✓ | ✓ | ✓ | ✓ |
| View All Records | ✓ | ✓ | - | - |
| View Own Records | ✓ | ✓ | ✓ | ✓ |
| Edit All Records | ✓ | ✓ | - | - |
| Edit Own Records | ✓ | ✓ | ✓ | ✓ |
| Delete Records | ✓ | ✓ | - | - |
| Manage Users | ✓ | - | - | - |
| View Reports | ✓ | ✓ | - | - |
| Export Data | ✓ | ✓ | - | - |
| App Settings | ✓ | - | - | - |
Testing Role Permissions
Creating Test Users
- Create a test user for each role
- Use obvious email addresses (admin-test@example.com, manager-test@example.com)
- Document test user credentials
- Use these accounts for ongoing testing
Testing Process
- Log in as each test user
- Verify page access - Can they access pages they should? Are pages they shouldn't see hidden?
- Check component visibility - Do they see appropriate components?
- Test field permissions - Can they edit fields they should? Are sensitive fields hidden?
- Try actions - Can they perform allowed actions? Are restricted actions unavailable?
- Check data filtering - Do they see only the data they should?
- Test edge cases - What happens if they try to access pages directly via URL?
Common Testing Scenarios
Scenario 1: Restricted Page Access
- Log in as Employee
- Try to access Admin-only page by typing URL directly
- Should be redirected or see "Access Denied"
Scenario 2: Component Visibility
- Log in as Manager
- View dashboard
- Verify you see manager components but not admin-only components
Scenario 3: Field Editing
- Log in as Employee
- Try to edit a record
- Verify sensitive fields are read-only or hidden
- Verify allowed fields can be edited
Scenario 4: Data Filtering
- Log in as Sales Rep
- View sales list
- Verify you only see your own sales, not all sales
Role Permission Best Practices
1. Principle of Least Privilege
- Give users only the permissions they need
- Start with minimal access and add as needed
- Don't make everyone an admin
- Review and adjust permissions regularly
2. Keep Roles Simple
- Don't create too many roles (harder to manage)
- Use 3-7 roles for most applications
- Make role purposes clear
- Combine similar roles when possible
3. Document Roles
- Add descriptions to each role
- Create a permission matrix (spreadsheet or table)
- Document why each permission was granted
- Keep documentation updated
4. Plan Before Building
- Map out roles before creating pages
- Identify user types and their needs
- Create permission matrix upfront
- Design pages with roles in mind
5. Consistent Naming
- Use consistent role names across apps
- Use business-friendly terms (not technical jargon)
- Make role names self-explanatory
6. Avoid Over-Complication
- Don't create role combinations for every scenario
- Use page rules for complex conditional access (covered in next article)
- Balance security with usability
7. Regular Audits
- Review role assignments quarterly
- Remove permissions that are no longer needed
- Verify new features have appropriate permissions
- Update documentation
8. Test Thoroughly
- Always test as each role
- Test before and after making changes
- Verify security before going live
- Have others test (they'll find things you miss)
Common Role Scenarios
Scenario 1: CRM Application
Roles
- Admin - Full system access
- Sales Manager - View all leads, edit team data, reports
- Sales Rep - View/edit own leads and opportunities
- Support - View customer data, add support tickets
Key Permissions
| Feature | Admin | Sales Mgr | Sales Rep | Support |
|---|---|---|---|---|
| View All Leads | ✓ | ✓ | - | - |
| View Own Leads | ✓ | ✓ | ✓ | - |
| Edit All Leads | ✓ | ✓ | - | - |
| Create Leads | ✓ | ✓ | ✓ | - |
| Delete Leads | ✓ | - | - | - |
| View Reports | ✓ | ✓ | - | - |
| View Customers | ✓ | ✓ | ✓ | ✓ |
| Manage Users | ✓ | - | - | - |
Scenario 2: Project Management
Roles
- Admin - Full system access
- Project Manager - Manage assigned projects
- Team Member - Work on assigned tasks
- Client - View own projects, read-only
Key Permissions
| Feature | Admin | PM | Team | Client |
|---|---|---|---|---|
| Create Projects | ✓ | ✓ | - | - |
| Edit All Projects | ✓ | - | - | - |
| Edit Own Projects | ✓ | ✓ | - | - |
| View All Projects | ✓ | - | - | - |
| View Assigned Projects | ✓ | ✓ | ✓ | ✓ |
| Create Tasks | ✓ | ✓ | ✓ | - |
| Edit Own Tasks | ✓ | ✓ | ✓ | - |
| View Time Reports | ✓ | ✓ | - | - |
| View Budget | ✓ | ✓ | - | - |
Scenario 3: Customer Portal
Roles
- Admin - Internal administrator
- Staff - Internal employees
- Customer - External customers
Key Permissions
| Feature | Admin | Staff | Customer |
|---|---|---|---|
| View All Orders | ✓ | ✓ | - |
| View Own Orders | ✓ | - | ✓ |
| Create Orders | ✓ | ✓ | ✓ |
| Edit Orders | ✓ | ✓ | - |
| View All Customers | ✓ | ✓ | - |
| Edit Own Profile | ✓ | - | ✓ |
| View Invoices | ✓ | ✓ | ✓ (own) |
| Submit Support Tickets | ✓ | - | ✓ |
| View Reports | ✓ | ✓ | - |
Summary
- What roles are - Sets of permissions assigned to user groups
- Creating roles - How to define roles in Tadabase
- Page-level permissions - Controlling which pages each role can access
- Component-level permissions - Showing different components to different roles
- Field-level permissions - Controlling field visibility and editability
- Action link permissions - Restricting actions based on role
- Data permissions - Filtering data differently for each role
- Testing roles - Verifying permissions work correctly
- Best practices - Guidelines for effective role management
- Common scenarios - Real-world role configurations
Next: Page Rules and Access Control - Advanced Dynamic Permissions
Hands-On Exercise (To Be Added)
Exercise placeholders will include practical activities such as:
- Creating multiple roles (Admin, Manager, Employee)
- Configuring page permissions for each role
- Setting up component visibility by role
- Configuring field permissions in forms
- Testing permissions with different user accounts
- Building a permission matrix for your app
Knowledge Check (To Be Added)
Quiz questions will test understanding of:
- What roles are and why they're important
- How to set page-level permissions
- Difference between component and field permissions
- When to use different permission types
- Best practices for role management
- How to test role permissions
We'd love to hear your feedback.