Introduction
Manage administrator accounts with roles, permissions, and access control.
🎯 What does this module do?
The Admins module lets you retrieve who has access to your OneEntry admin panel and what they can do.
📖 Simple Explanation
Imagine you're running a website with a team:
- 👑 Super Admin - Can do everything (you, the owner)
- 👨💼 Content Manager - Can edit pages and products
- 📝 Editor - Can write blog posts
- 🎨 Designer - Can manage images and blocks
- 👀 Viewer - Can only view data, no editing
Instead of giving everyone full access, you:
- ✅ Create admin accounts for team members
- ✅ Assign specific roles and permissions
- ✅ Control what each person can see and edit
- ✅ Track who made changes (audit trail)
- ✅ Revoke access when someone leaves the team
Real-world example:
Without Admin Management:
- Everyone shares one account → Can't track who did what ❌
- Everyone has full access → Risky! ❌
- No control over permissions ❌
With Admin Management:
- Each team member has their own account ✅
- Specific permissions per role ✅
- Full audit trail of changes ✅
- Easy to add/remove team members ✅
✨ Key Concepts
What is an Administrator?
An administrator (admin) is a user with elevated access to manage your OneEntry project:
- Access rights - What parts of the system they can access
- Permissions - What actions they can perform (create, edit, delete)
- Role - Their position/responsibility (e.g., "Content Manager")
- Account info - Name, email, status
Administrator vs Regular User
| Type | Purpose | Example |
|---|---|---|
| Administrator | Manages the system (backend) | You, your team members |
| Regular User | Uses your app/website (frontend) | Your customers, website visitors |
Key difference: Admins manage content, Users consume content.
📋 What You Need to Know
Admin Attributes
Every admin has these key fields:
{
id: 123, // Unique admin ID
attributeSetId: 27, // Unique attribute set ID
identifier: "admin", // Unique identifier
attributeSetIdentifier: "admins", // Unique attribute set identifier
position: 1, // Position
isSync: true, // Whether to sync with the backend
attributeValues: {} // Attribute values
}
Filtering Admins
Use filters to find specific admins:
Condition markers (same as Products module):
| Marker | Meaning | Example |
|---|---|---|
| eq | Equal | statusId = 1 (active only) |
| neq | Not equal | role ≠ "Viewer" |
| in | Contains (one of) | role in ["Editor", "Manager"] |
| nin | Not contains | email not in ["@temp.com"] |
| exs | Exists (has value) | Has lastLogin |
| nexs | Does not exist | Never logged in |
Security Considerations
Important:
- 🔒 Never expose admin credentials in frontend code
- 🔐 Use secure tokens for API calls
- 👤 Implement least privilege - give minimum permissions needed
- 📝 Audit changes - track who did what
- 🚪 Revoke access immediately when someone leaves
❓ Common Questions (FAQ)
What's the difference between Admins and Users modules?
- Admins - Manage your team (backend users who manage the system)
- Users - Manage customers (frontend users who use your app/website)
How do I restrict what an admin can do?
Use roles and permissions.
What happens to content when I delete an admin?
Content stays, but creator reference breaks.
Best practice: Deactivate instead of delete
💡 Important Notes
Security Best Practices
Always validate admin permissions
🎓 Best Practices
- Use roles to group permissions
- Implement least privilege (minimum permissions needed)
- Deactivate instead of delete (preserve audit trail)
- Track admin actions (who did what, when)
- Review permissions regularly
- Use strong password policies
- Enable two-factor authentication (2FA)
- Set up email notifications for critical actions
For more information about the module's user interface, visit https://doc.oneentry.cloud/docs/category/administrators
Definition of the 'Admins' module
const { Admins } = defineOneEntry( "your-project-url", { "token": "your-app-token" });
const body = [ { "attributeMarker": "num", "conditionMarker": "mth", "conditionValue": 1 }];
Parameters schema
Schema: (body)
attributeMarker: string
Text identifier attribute
example: price
conditionMarker: string
Text identifier condition, possible values: 'in' - contains, 'nin' - does not contain, 'eq' - equal, 'neq' - not equal, 'mth' - more than, 'lth' - less than, 'exs' - exists, 'nexs' - does not exist, 'pat' - pattern, for example -, where '' represents any character, 'same' - same value as the selected attribute*
example: in
Enum: [ in, nin, eq, neq, mth, lth, exs, nexs, pat, same ]
conditionValue: number
Condition value
example: 1
🔗 Related Documentation
- Users Module - Manage customer accounts (frontend users)
- AuthProvider Module - Authentication system
- Forms Module - Create admin registration forms