Permissions System
CDN Manager features a comprehensive permissions system that allows you to control exactly who can access and manage your files. This guide explains how permissions work and how to configure them.
Granular Permission System
CDN Manager uses a fully granular permission system where individual permissions are granted to users. Roles are assigned internally based on which permissions a user has been granted, making the system highly flexible and customizable.
How It Works
- Permissions are granted individually - Users receive specific permissions like
cdn.upload,cdn.delete, oradmin.users.manage - Roles are automatically assigned - The system internally assigns role labels (like CDN_MANAGER) based on the combination of permissions granted
- Full customization - You can grant any combination of permissions to create custom access levels beyond the predefined roles
Individual Permissions
The following individual permissions can be granted:
General Admin Permissions
owner- Full unrestricted access (bypasses all checks)admin.settings.manage- Manage system settingsadmin.audit.view- View audit logs
CDN/File Management Permissions
cdn.admin- CDN administrator accesscdn.view- View files and folderscdn.download- Download filescdn.upload- Upload filescdn.delete- Delete filescdn.edit- Edit file contentscdn.move- Move/rename filescdn.folder.create- Create new folderscdn.folder.delete- Delete folderscdn.directory.permissions- Manage directory permissionscdn.file.permissions- Manage file permissions
User Management Permissions
admin.users.manage- Manage user accountsadmin.users.permissions- Assign permissions to usersusers.ban- Ban/unban users
Permission Roles
For convenience, the system recognizes standard role combinations. These roles are automatically assigned based on the individual permissions granted:
Owner (OWNER)
Required Permission: owner
- Full unrestricted access to everything
- Can manage all users and their permissions
- Can access admin panel
- Can modify all settings
- Bypasses all access restrictions
- Configured via the
OWNERSenvironment variable
CDN Manager (CDN_MANAGER)
Required Permissions:
cdn.admincdn.viewcdn.uploadcdn.deletecdn.editcdn.movecdn.folder.createcdn.folder.deletecdn.directory.permissionscdn.file.permissions
Capabilities:
- Full file management capabilities
- Can upload, download, view, edit, move, and delete files
- Can create and delete folders
- Can manage directory and file permissions
- Cannot access admin panel (unless granted admin permissions)
- Cannot manage users or system settings (unless granted admin permissions)
CDN Uploader (CDN_UPLOADER)
Required Permissions:
cdn.viewcdn.uploadcdn.folder.create
Capabilities:
- Can upload files
- Can create folders
- Can view files they have access to
- Cannot edit, move, or delete files
- Cannot download files (unless
cdn.downloadpermission is explicitly granted)
CDN Viewer (CDN_VIEWER)
Required Permission: cdn.view
Capabilities:
- Can only view files
- Cannot upload, edit, move, or delete
- Read-only access to files and folders
- Cannot download files (unless
cdn.downloadpermission is explicitly granted)
User Moderator (USER_MODERATOR)
Required Permissions:
admin.users.manageusers.banadmin.users.permissions
Capabilities:
- Can manage user accounts
- Can ban or remove bans from users
- Can assign permissions to users
- Cannot access file management features (unless granted CDN permissions)
- Special administrative role for user management
Custom Permission Combinations
Since permissions are fully granular, you can create custom access levels by granting any combination of individual permissions. This allows you to tailor access control to your specific needs.
Examples of Custom Combinations
Download-Only User:
cdn.viewcdn.download
Upload + Download User:
cdn.viewcdn.uploadcdn.downloadcdn.folder.create
File Editor (No Delete):
cdn.viewcdn.editcdn.move
Permission Manager Only:
cdn.directory.permissionscdn.file.permissions
Audit Reviewer:
admin.audit.view
You can mix and match any permissions to create the exact access level you need for each user.
Permission Levels
Permissions can be set at three levels with the following priority order:
Permission Priority (Override System)
When determining a user's access to a file, the system checks permissions in this order:
- File-Level Permissions (Highest Priority)
- Directory-Level Permissions (Medium Priority)
- General User Permissions (Lowest Priority)
Important: More specific permissions always override general ones. If a user has file-level permissions set, those will be used instead of directory or general permissions. If no file-level permissions exist, directory-level permissions are checked. If neither exists, general user permissions apply.
File-Level Permissions
- Highest priority - Override all other permission levels
- Applied to specific individual files
- Allow granular control over sensitive documents
- Useful for restricting or granting access beyond directory settings
- Set via the File Permissions modal
Example: A user with general cdn.delete permission can have that permission removed for a specific file by setting file-level permissions without cdn.delete.
Directory-Level Permissions
- Medium priority - Override general user permissions
- Applied to entire folders and their contents
- Inherited by all files and subfolders within that directory
- Can be synced to all children when updated
- Set via the Directory Permissions modal
Example: A user with general cdn.view permission can be granted cdn.upload for a specific directory by setting directory-level permissions.
General User Permissions
- Lowest priority - Used only when no file or directory permissions are set
- Applied globally across the entire system
- Set via Admin Panel > Users > Permissions
- Serves as the baseline permission level for the user
Access Modes
In addition to role-based permissions, directories and files can have access modes:
Public
- Accessible to everyone, no login required
- Anyone with the link can view/download
- Useful for publicly shared assets
Users-only
- Requires authentication
- Any logged-in user can access
- Role permissions still apply
CDN-only
- Only accessible via CDN routes (
/cdn/[...path]) - Not accessible through the main file manager interface
- Useful for assets embedded in websites
Whitelist
- Only accessible to whitelisted IPs or domains
- Configure whitelist in directory/file settings
- Supports CIDR notation (e.g.,
192.168.1.0/24) - Can whitelist specific domains (e.g.,
example.com)
Configuring Permissions
Setting Directory Permissions
- Navigate to the directory in the file manager
- Click the settings icon or right-click the folder
- Select "Directory Permissions"
- Choose users and their permission levels
- Optionally check "Sync to all children" to apply to subfolders
- Click Save
Setting File Permissions
- Locate the file in the file manager
- Click the settings icon or right-click the file
- Select "File Permissions"
- Choose users and their permission levels
- Click Save
Configuring Access Modes
- Access the directory or file settings modal
- Select the access mode from the dropdown:
- Public
- Users-only
- CDN-only
- Whitelist
- If using Whitelist mode, add IP addresses or domains
- Configure separate download permissions if needed
- Click Save
IP and Domain Whitelisting
When using Whitelist access mode, you can specify allowed IPs and domains:
IP Whitelisting
- Add individual IPs:
192.168.1.100 - Add CIDR ranges:
192.168.1.0/24 - Supports both IPv4 and IPv6
Domain Whitelisting
- Add specific domains:
example.com - Subdomains are matched separately
- Useful for restricting access to specific websites
Blacklisting
You can also block specific IPs, domains, users, or emails:
- Navigate to Admin Panel > Ban List
- Add ban entries with optional expiration dates
- Ban types: IP, Domain, User, Email
- Banned entities cannot access any resources
Permission Inheritance and Priority
Permissions follow these rules:
Priority Order
- File-level permissions override directory permissions (File > Directory > General)
- Directory permissions override general user permissions
- General user permissions are the baseline (used when no file or directory permissions exist)
- Owner permissions always bypass all restrictions (the
ownerpermission ignores all other checks) - Bans are checked first (banned users cannot access anything, regardless of permissions)
How Overrides Work
Granting Additional Access:
- User has general permission:
cdn.view - Directory permission grants:
cdn.view,cdn.upload,cdn.delete - Result: User can view, upload, and delete files in that directory
Restricting Access:
- User has general permissions:
cdn.view,cdn.upload,cdn.delete - File permission grants only:
cdn.view - Result: User can only view that specific file, cannot upload or delete it
Complete Override: When you set permissions at a more specific level (file or directory), those permissions completely replace the less specific permissions for that resource. The system doesn't combine or merge permissions from different levels.
Inheritance Rules
- Directory permissions inherit to children (unless explicitly overridden)
- Subdirectories inherit parent directory permissions (until different permissions are set)
- Files inherit directory permissions (until file-level permissions are set)
Best Practices
Use Directory Permissions for Organization
- Set permissions at the folder level for easier management
- Use file-level permissions sparingly for exceptions
Separate Public and Private Content
- Create separate top-level folders for public vs. private files
- Set appropriate access modes on these folders
Use Whitelist for Embedded Assets
- For images/videos embedded on specific websites
- Prevents hotlinking from unauthorized domains
Regular Permission Audits
- Review permissions periodically
- Remove access for users who no longer need it
- Check audit logs for unusual access patterns
Owner Account Security
- Limit the number of owner accounts
- Use owner accounts only when necessary
- Consider using CDN_MANAGER role for day-to-day operations
Examples
Example 1: Public Image Gallery
Directory: /public-images
Access Mode: Public
Permissions: None needed (public access)
Example 2: Team Documents
Directory: /team-docs
Access Mode: Users-only
Permissions:
- [email protected]: CDN_MANAGER (all CDN permissions)
- [email protected]: CDN_UPLOADER (upload, view, create folders)
- [email protected]: CDN_VIEWER (view only)
Or with custom granular permissions:
- [email protected]: Full management (cdn.admin, cdn.view, cdn.upload, cdn.delete, cdn.edit, cdn.move, cdn.folder.create, cdn.folder.delete)
- [email protected]: Upload only (cdn.view, cdn.upload, cdn.folder.create)
- [email protected]: View and download (cdn.view, cdn.download)
Example 3: Website Assets
Directory: /website-assets
Access Mode: Whitelist
Whitelist: example.com, www.example.com
Permissions: Public via whitelist
Example 4: Confidential Files
Directory: /confidential
Access Mode: Users-only
Permissions:
- [email protected]: CDN_MANAGER
- [email protected]: CDN_VIEW
File: /confidential/sensitive-report.pdf
Permissions:
- [email protected]: CDN_VIEW
(Restricts even further than directory)
Troubleshooting
User Cannot Access Files
- Check if user is banned (Admin Panel > Ban List)
- Verify user has appropriate role permission
- Check directory access mode
- Verify IP/domain if using whitelist
- Check audit logs for access attempts
Files Accessible When They Shouldn't Be
- Check if directory is set to Public
- Verify file-level permissions aren't overriding
- Check if user has Owner role
- Review whitelist/blacklist settings
Permission Changes Not Taking Effect
- Permissions are applied immediately
- User may need to refresh the page
- Check if "Sync to children" was enabled for directory changes
- Verify changes were saved successfully