Documentation
¶
Index ¶
- Constants
- func APIUserIDToDBID(userID uint32) uint
- func EnsureDefaultRootACLs(db *gorm.DB, serverID uint) error
- func IsAPIUserID(userID uint32) bool
- func IsAdminForDisplay(db *gorm.DB, serverID uint, userID uint32) bool
- func MakeAPIUserID(apiUserDBID uint) uint32
- func ResolveAPIAdmin(db *gorm.DB, userID uint32) bool
- type Evaluator
Constants ¶
const ( // APIUserIDBase is the high bit; API userIDs are 0x80000000 | users.id. // Max users.id is typically small, so 0x80000001, 0x80000002, etc. APIUserIDBase uint32 = 0x80000000 // APIUserIDMask extracts the DB id from a synthetic userID. APIUserIDMask uint32 = 0x7FFFFFFF )
RBAC constants for API user ID mapping. API users (from the management API users table) receive synthetic Mumble userIDs in a reserved range to avoid collision with registered_users (1, 2, 3...) and SuperUser (0). This allows the ACL evaluator to resolve API roles for @admin.
Variables ¶
This section is empty.
Functions ¶
func APIUserIDToDBID ¶
APIUserIDToDBID extracts the users.id from a synthetic userID. Returns 0 if not an API userID.
func EnsureDefaultRootACLs ¶
EnsureDefaultRootACLs seeds default ACLs and groups for the root channel if none exist.
func IsAPIUserID ¶
IsAPIUserID returns true if userID is in the API user range.
func IsAdminForDisplay ¶
IsAdminForDisplay returns true if the user has admin privileges (API admin or stored admin group). Used by the REST API when returning connected users for display in the channel tree. Note: userID 0 (server-password users not in registered_users) are not shown as admin.
func MakeAPIUserID ¶
MakeAPIUserID creates a synthetic Mumble userID for an API user (users.id).
Types ¶
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator resolves permissions for a user in a channel using DB ACLs and groups.
func NewEvaluator ¶
NewEvaluator creates an ACL evaluator with DB and manager dependencies.
func (*Evaluator) EffectivePermissions ¶
EffectivePermissions returns the permission bitmask for userID in channelID.
func (*Evaluator) InvalidateCache ¶
func (e *Evaluator) InvalidateCache()
InvalidateCache clears the permission cache. Call when ACLs, groups, or user state change.