role

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

View Source
const Admin = "admin"

Admin is the role holding every authority over the site.

View Source
const Author = "author"

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

View Source
const Editor = "editor"

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

Variables

This section is empty.

Functions

func Can

func Can(role string, capability Capability) bool

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

func CapabilitiesOf

func CapabilitiesOf(role string) []string

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

func MayChange

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

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

func Privileged

func Privileged() gouncer.Roles

Privileged returns the roles that administer accounts.

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