Documentation
¶
Overview ¶
Package role names the roles a Gophenberg account holds and the capabilities they carry.
Index ¶
Constants ¶
const Admin = "admin"
Admin is the role holding every authority over the site.
const Author = "author"
Author is the role working only its own content and media.
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 ¶
CapabilitiesOf returns the capabilities a role carries, named for a caller outside this package.
func MayChange ¶
MayChange reports whether an account of the given role may change work the author owns.
func Privileged ¶
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.