Skip to main content
Infidec Marketplace logo
v1.0.0

Type to search pages and sections, e.g. “razorpay”, “package name”, “SHA”.

Roles, Staff & Permissions

Create custom roles with per-module access, add staff accounts that sign in to the Admin Panel, and understand how the API enforces permissions.

The Admin Panel has three kinds of back-office accounts:

AccountRoles stored on the userAccess
Super adminsuper-adminEverything. Cannot be edited by other admins, suspended or removed
AdminadminEverything (all modules)
Staffstaff + one custom role, e.g. ["staff", "Moderator"]Only the modules the role grants, plus the Dashboard

Customers and sellers (customer, seller) cannot open the Admin Panel. The first super admin is created during installation (see Create the First Admin).

Modules

A role is a list of modules. Each module unlocks a part of the sidebar and the matching API routes.

Module (checkbox label)KeySidebar items
DashboarddashboardDashboard (always granted)
Ads & JobsadsAds Listing → All Ads, Jobs
CategoriescategoriesAds Listing → Categories
Custom Fieldscustom_fieldsAds Listing → Custom Fields
Content ManagementcontentSlider, Home Screen, Feature Section, Offer Item Tips, Banner Ads
Chat ManagementchatChats, Chat Templates
PackagespackagesSubscription Packages, Featured Ad Plans, User Subscriptions
TransactionstransactionsPayment Transactions, Bank Transfer
Seller ManagementsellersVerification Fields, Seller Verification, Seller Review, Seller Review Report
Forms & BlogsblogsBlogs, Blog Category, FAQs (and the AI draft button)
CustomerscustomersCustomers, User Queries
RolesrolesRole
StaffstaffStaff Management
LocationslocationsCurrencies, Countries, States, Cities, Areas
ReportsreportsReport Reasons, User Reports
NotificationsnotificationsNotification
SettingssettingsSettings, System Status, Payment Gateways, Languages, File Manager, Log Viewer…

Some pages need data from another module as a lookup. Staff can read (GET only) that data without being able to change it. For example, a role with Content Management can list categories and approved ads for the Slider page; a role with Customers can list packages for Assign package; a role with Notifications can list users and ads.

The Home Screen settings (settings/home) are guarded by Content Management, not Settings.

Role

Admin → Customers & Roles → Role (page title Role Management). Data: the roles collection.

Role Management
Admin → Customers & Roles → Role
ColumnShows
No.Role id
NameRole name
PermissionsOne badge per granted module
ActionEdit, Delete

Click Create New Role:

FieldNotes
Role nameRequired and unique. "Assign this role to staff in Staff Management"
Module accessOne checkbox per module (table above). Dashboard is ticked by default

Role definitions are cached by each API instance for about 30 seconds, so a change can take that long to apply everywhere.

Staff Management

Admin → Customers & Roles → Staff Management lists every account with staff, admin or super-admin.

Staff Management
Admin → Customers & Roles → Staff Management
ColumnShows
NameAvatar, name, email
EmailEmail
RoleSuper admin, Admin or the custom role name
StatusToggle active / suspended. Disabled for super admins and for yourself
ActionEdit, Change password, Remove

Create a staff member

Click Create New Staff:

FieldNotes
NameRequired
EmailRequired, must not already exist ("The email has already been taken.")
PasswordRequired, at least 8 characters
RoleAdministrator (full access) (only shown to admins) or any custom role
StatusActive or Suspended

Click Save. The API (POST /admin/staff) creates the Firestore user (verified, login_type: email) and a Firebase Auth account with the same email and password. The person signs in at your Admin Panel URL, for example https://admin.yourcompany.com.

Edit, change password, suspend

  • Edit / Change password open the same dialog. New password (optional) changes the Firebase Auth password when filled.
  • Changing Role updates the user's roles (not possible for a super admin).
  • Status off disables the Firebase Auth account.

Remove

Confirm "Remove {name} from staff? Their admin access is revoked."

  • Accounts that were only staff (no customer/seller role and no ads) are deleted from Firestore and Firebase Auth.
  • Accounts that are also customers or sellers keep their marketplace account; they just lose the admin roles and are signed out.

You cannot remove yourself or a super admin. Removals are logged as staff.removed.

How permissions are enforced

The sidebar hides modules you do not have (components/shell.tsx), but the real check is in the API. Every /admin/* route requires a signed-in user with admin, super-admin or staff, and then the module guard in functions/src/routes/admin/guard.ts:

functions/src/routes/admin/guard.ts
export const can = (module: Module, readBy: readonly Module[] = []) => ...
// admins pass; staff need the module (or a readBy module for GET requests)

A staff member who calls a route without the module gets 403 "You do not have permission to perform this action." The Admin Panel loads the user's modules from GET /admin/me.

Next: Push Notifications →

Something unclear or out of date? Tell us. contact@infidec.com