authz

package
v1.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package authz provides role-based authorization helpers.

Index

Constants

View Source
const (
	RoleAdmin     = "admin"
	RoleModerator = "moderator"
	RoleUser      = "user"
)

Roles define normalized role names used for authorization checks.

Variables

This section is empty.

Functions

func IsAdmin

func IsAdmin(role string) bool

IsAdmin reports whether role is an administrator role.

func IsModeratorOrAdmin

func IsModeratorOrAdmin(role string) bool

IsModeratorOrAdmin reports whether role is a moderator or administrator role.

func NormalizeRole

func NormalizeRole(role string) string

NormalizeRole normalizes role strings for comparisons.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL