mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
- Added type annotations and class definitions in the dashboard layout, stats, and data table modules for improved type safety and documentation. - Introduced new classes for UI components, props, and configuration in the form builder, navigation menu, notification center, and UI dialogs packages. - Implemented detailed type definitions for actions, fields, and pagination components to streamline usage and enhance clarity. - Updated initialization functions in multiple packages to include versioning and installation context. - Improved structure and readability of the codebase by organizing and documenting component properties and methods.
30 lines
569 B
Lua
30 lines
569 B
Lua
-- Level 6 (Supergod) package initialization
|
|
local levels = require("ui_permissions.levels")
|
|
|
|
---@class UILevel6
|
|
local M = {}
|
|
|
|
---@type number
|
|
M.REQUIRED_LEVEL = levels.SUPERGOD
|
|
|
|
---@class User
|
|
---@field level number
|
|
|
|
---@class InitContext
|
|
---@field user User
|
|
|
|
---@class InitResult
|
|
---@field allowed boolean
|
|
---@field redirect? string
|
|
|
|
---@param context InitContext
|
|
---@return InitResult
|
|
function M.init(context)
|
|
if context.user.level < M.REQUIRED_LEVEL then
|
|
return { allowed = false, redirect = "/access-denied" }
|
|
end
|
|
return { allowed = true }
|
|
end
|
|
|
|
return M
|