Quasar Store Logo

Admin Access

This section explains how the admin and staff access system works, including permission levels, configuration setup, and database management. It covers how to grant, manage, and restrict access to the admin panel in a simple and practical way for server owners and developers.

How access works

The system uses two methods to grant access to the admin panel: a main admin defined in the config and users stored in the database. Both systems work together.

There are two levels: Admin and Staff. Both can open the panel, but only Admin has full control (user management and settings). Staff has limited access.





Main admin (config.lua)

This is the primary access. It is defined in config.lua and always has full permissions. It exists so you can access the panel on a fresh server before creating database users.



Example:

Config.Admin = { mainAdminIdentifierType = 'license', mainAdminIdentifier = 'license:abcdef123456', adminPanelCommand = 'adminpanel' }

To get your identifier, you can use txAdmin or a command like this:

RegisterCommand('whoami', function(src) for _, id in ipairs(GetPlayerIdentifiers(src)) do print(id) end end)

If you don’t want to use this system, just leave the identifier empty.





Database users

The system also stores users in a table called qs_licenses_users. This is where you define who is Admin or Staff.

The system automatically detects players by matching their identifiers (license, steam, discord, etc).



SQL example:

INSERT INTO qs_licenses_users (license_identifier, permission_level, active) VALUES ('license:abcdef123456', 1, 1);
permission_level = 1 → Admin
permission_level = 2 → Staff
active = 1 → Access enabled





Adding users from the panel

You can add users directly from the Admin Panel without touching the database.

Select an online player, choose Admin or Staff, and save.

The system stores the correct identifier (not the temporary server ID).





Removing access

You can remove access from the panel or directly from the database.

Disabling keeps the record, deleting removes it completely.

SQL example:

UPDATE qs_licenses_users SET active = 0 WHERE id = 1;





Commands

The panel is opened with a configurable command.

Example:

/adminpanel

There is also a command to reposition the UI:

/placement





Open panel from another script

You can trigger the panel from another resource.

Example:

TriggerEvent('qs-licensecreator:server:requestOpen', { panel = 'admin-panel' })

The system always checks permissions before opening it.