permcheck

package
v1.8.2 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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