mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-27 23:34:56 +00:00
- 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.
28 lines
895 B
Lua
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
|