Files
metabuilder/packages/ui_level3/seed/scripts/moderation.lua
T
git f3b1058d62 feat(ui): Add UI components for header, intro, and user dashboard
- Implemented App Header with lifecycle and rendering scripts.
- Created Intro Section with rendering logic.
- Developed User Dashboard with profile, comments, and chat functionalities.
- Added Admin Panel for user and content management.
- Introduced Application Builder with schemas and workflows.
- Established Super God panel for tenant management.
- Updated metadata and tests for all new components and functionalities.
- Enhanced UI Pages Bundle to include dependencies for all levels.
- Improved permission checks and constants in the permissions package.
2025-12-29 23:31:43 +00:00

30 lines
856 B
Lua

local check = require("check")
local LEVELS = require("levels")
local M = {}
function M.deleteUser(ctx)
if not check.can_access(ctx.user, LEVELS.ADMIN) then
return { success = false, error = "Admin required" }
end
if ctx.targetId == ctx.user.id then
return { success = false, error = "Cannot delete yourself" }
end
return { success = true, action = "delete_user", id = ctx.targetId }
end
function M.editUser(ctx)
if not check.can_access(ctx.user, LEVELS.ADMIN) then
return { success = false, error = "Admin required" }
end
return { success = true, action = "open_edit_dialog", id = ctx.targetId }
end
function M.banUser(ctx)
if not check.can_access(ctx.user, LEVELS.ADMIN) then
return { success = false, error = "Admin required" }
end
return { success = true, action = "ban_user", id = ctx.targetId }
end
return M