mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-03 10:14:52 +00:00
f3b1058d62
- 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.
30 lines
856 B
Lua
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
|