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