Files
metabuilder/packages/ui_level6/seed/scripts/init.lua
JohnDoe6345789 bf1401fe34 Enhance module definitions and add type annotations across various packages
- 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.
2025-12-30 10:21:33 +00:00

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