Documentation
¶
Overview ¶
Package capability defines the Published Language of authorization: the capability names every module checks and the users module resolves. Names are stable strings so modules never hardcode them and no second vocabulary drifts elsewhere. Unknown names fail closed at the resolver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManageContent ¶
ManageContent builds the per-type manage capability for a post-type slug.
Types ¶
type Capability ¶
type Capability string
Capability names a permission the kernel resolver decides.
const ( // CapabilityAdmin is the reserved superuser grant. CapabilityAdmin Capability = "admin" // CapabilityMedia grants media upload/generation. CapabilityMedia Capability = "media" // CapabilityComments grants authenticated commenting. CapabilityComments Capability = "comments" // CapabilityPublishContent grants direct publishing. CapabilityPublishContent Capability = "content.publish" // CapabilityManageContent is the prefix for per-type manage grants of // the form "content.manage:<post-type>". Use ManageContent to build it. CapabilityManageContent Capability = "content.manage" )
func Split ¶
func Split(capability string) (name Capability, arg string)
Split breaks a capability into its name and argument ("content.manage", "post" for "content.manage:post"). A bare name yields an empty argument.
Click to show internal directories.
Click to hide internal directories.