mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-04 02:34:52 +00:00
20 lines
359 B
Lua
20 lines
359 B
Lua
---@class Permissions
|
|
local M = {}
|
|
|
|
---@class User
|
|
---@field role? "public"|"admin"|"god"|"supergod"
|
|
|
|
---@param user User
|
|
---@return boolean
|
|
function M.can_create_tournament(user)
|
|
local role = user.role or "public"
|
|
local allowed = {
|
|
admin = true,
|
|
god = true,
|
|
supergod = true
|
|
}
|
|
return allowed[role] == true
|
|
end
|
|
|
|
return M
|