The boss menu
One app for whoever runs a business: who works there, who gets hired, who gets let go, who moves up, what is in the account, and who owes the company money.
Nothing in it reimplements your framework. Hiring, firing and grades are the frameworkโs own operations, asked for through the bridge and checked again on the way in โ ESX, QBCore and QBox each in their own words.
The app is not on the Home Screen of somebody who runs nothing. It arrives on its own the next time a new boss opens their phone, and leaves the same way.
Who is in charge
Section titled โWho is in chargeโMost servers already mark it: ESX marks a grade is_boss, QB marks a job isboss. If yours does, this file needs nothing.
Config.Apps.Boss.Bosses in shared/config/boss.lua is for the ones that do not โ and for the ones where being in charge is not one rank but several, each allowed a little more than the one below:
Bosses = { mechanic = 4, -- grade 4 and above, everything
police = { -- a ladder, where each rung adds to the ones below it [3] = { 'Hire', 'Promote' }, -- a Sergeant may hire and promote, and nothing else [4] = { 'Account', 'Invoice' }, -- a Lieutenant may also see the account and bill people [5] = true, -- a Captain may do everything left in Actions },}The rungs add up, which is what makes a ladder read like one: a rank can do everything the rank below it can, plus whatever is written on its own line. Nobody repeats a list at every grade, and nobody loses a power by being promoted.
A grade with an empty list is still in charge: they open the app and see who works there, which is the one thing being in charge always means.
What anybody may do at all
Section titled โWhat anybody may do at allโConfig.Apps.Boss.Actions is the ceiling for the whole city โ nothing in Bosses can grant something turned off there. It is the short way to take one power off every business at once.
Actions = { Hire = true, Fire = true, Promote = true, Account = true, Deposit = true, Withdraw = true, Invoice = true },A power that is off is not drawn and refused, in that order. A button that is only missing from the screen is not switched off.
The rules the screen cannot argue with
Section titled โThe rules the screen cannot argue withโ- Hiring is done standing next to somebody. The list is whoever is within a few metres, and the same distance is checked again when the name is sent, so a name in that list is a name that will still be accepted a moment later. A menu that can employ anybody in the city by guessing an id is a menu that will be used to do exactly that.
- Nobody may touch themselves or anybody at their own grade or above. Both are explained on the screen rather than being buttons that quietly do nothing.
- A grade is chosen from the ladder the server sent, never typed.
- Identifiers never cross the wire. Everybody in the roster is a ticket that means something only to this session.
- Money moves under a lock, per company, and is put back if the other half fails.