Documentation
¶
Overview ¶
Package accessrequests backs the "Request Editor access" action on the 403 screen: it names the smallest built-in role that grants a missing permission and sends the request to the members who manage the team. Nothing changes until one of them does.
Index ¶
Constants ¶
View Source
const KindAccessRequested = "access_requested"
KindAccessRequested is the notification kind team managers receive.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register adds the access request operations. Any member may call them (no permission needed); API keys and agents may not.
func SmallestRole ¶
func SmallestRole(perm authz.Permission) authz.BuiltinRole
SmallestRole returns the first built-in role, from Viewer up, that holds perm.
Types ¶
type AccessRequestResult ¶
type AccessRequestResult struct {
RoleName string `json:"roleName"`
Notified []string `json:"notified" doc:"Members who received the request"`
}
AccessRequestResult says who was asked.
type AccessSuggestion ¶
type AccessSuggestion struct {
Permission string `json:"permission" doc:"The missing permission"`
Action string `json:"action" doc:"What the permission allows, as a sentence subject" example:"Managing providers"`
RoleKey string `json:"roleKey" doc:"Smallest built-in role that grants it" example:"editor"`
RoleName string `json:"roleName" example:"Editor"`
YourRole string `json:"yourRole" example:"Viewer"`
// Owners are the workspace's Owners; Managers can change roles (team:manage).
Owners []string `json:"owners"`
Managers []string `json:"managers"`
// RequestedAt is set when you asked for this role in the last 24 hours.
RequestedAt *time.Time `json:"requestedAt,omitempty"`
}
AccessSuggestion is what the 403 screen shows before the person asks.
Click to show internal directories.
Click to hide internal directories.