permcheck

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package permcheck checks a second permission inside a handler, for operations whose requirement depends on the request (saving a segment in SQL mode needs segments:sql on top of segments:edit). Denials are written to the audit log and name who can help, like the API middleware does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Helpers

func Helpers(ctx context.Context, q *store.Queries, wsID uuid.UUID, perm authz.Permission) []string

Helpers names up to two active members who hold perm.

func Require

func Require(ctx context.Context, q *store.Queries, log *audit.Logger, wsID uuid.UUID, perm authz.Permission, action string) error

Require returns nil when the caller holds perm; otherwise it logs the denial and returns a 403 problem naming up to two members who can help.

Types

This section is empty.

Jump to

Keyboard shortcuts

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