role

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package role names the ranks a Gophenberg account holds and the capabilities they carry.

Index

Constants

View Source
const Admin = "admin"

Admin is the rank holding every authority over the site.

View Source
const Author = "author"

Author is the rank working only its own content and media.

View Source
const Editor = "editor"

Editor is the rank working every account's content and media.

Variables

This section is empty.

Functions

func Can

func Can(rank string, capability Capability) bool

Can reports whether a rank holds the capability, an unknown rank holding none.

func CapabilitiesOf

func CapabilitiesOf(rank string) []string

CapabilitiesOf returns the capabilities a rank carries, named for a caller outside this package.

func MayChange

func MayChange(rank string, actor, author uuid.UUID) bool

MayChange reports whether an account of the given rank may change work the author owns.

func Privileged

func Privileged() gouncer.Ranks

Privileged returns the ranks administering accounts, the cover the safety rails keep.

Types

type Capability

type Capability string

Capability is a named permission a decision point asks for.

const ChangeOthersWork Capability = "change_others_work"

ChangeOthersWork is the capability changing content and media another account wrote.

const ManageSettings Capability = "manage_settings"

ManageSettings is the capability writing the site wide settings.

const ManageThemes Capability = "manage_themes"

ManageThemes is the capability installing and switching themes.

const ManageTypes Capability = "manage_types"

ManageTypes is the capability reshaping the content model.

const ManageUsers Capability = "manage_users"

ManageUsers is the capability administering accounts.

Jump to

Keyboard shortcuts

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