Files
metabuilder/packages/stream_cast/seed/scripts/lua/permissions.lua
JohnDoe6345789 b20f2d2533 Add Media Daemon server and TV engine implementation
- Introduced `Server` class for managing the Media Daemon, including configuration, lifecycle, and HTTP route handling.
- Added `TvEngine` class for managing TV channels, scheduling, EPG generation, and streaming functionalities.
- Created `types.hpp` to define various data structures and enums for jobs, radio, TV channels, and plugins.
- Implemented main entry point in `main.cpp` to initialize and run the Media Daemon server with command-line and environment variable configurations.
- Established error handling and result management using a generic `Result` class.
- Included necessary headers and dependencies for media processing and plugin management.
2025-12-30 11:40:25 +00:00

28 lines
895 B
Lua

---@alias StreamUserRole "public" | "user" | "moderator" | "admin" | "god" | "supergod"
---@class StreamUser
---@field role? StreamUserRole User role
---@class StreamPermissionsModule
---@field can_publish fun(user: StreamUser): boolean Check if user can publish streams
---@field can_moderate fun(user: StreamUser): boolean Check if user can moderate streams
local M = {}
---Check if user can publish streams
---@param user StreamUser User to check
---@return boolean
function M.can_publish(user)
local role = user.role or "public"
return role == "moderator" or role == "admin" or role == "god" or role == "supergod"
end
---Check if user can moderate streams
---@param user StreamUser User to check
---@return boolean
function M.can_moderate(user)
local role = user.role or "public"
return role == "moderator" or role == "admin" or role == "god" or role == "supergod"
end
return M