grantsource

package
v1.163.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package grantsource is where a caller's write grants on Global folders are read from (#2684): the source the platform installs once at startup, and the SQL form of the path-segment rule a grant covers its folder by. It is a package of its own so pkg/resource's public surface carries neither.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(src Source)

Install sets the source grants are read from; nil uninstalls it.

func UnderSQL

func UnderSQL(path, folder string) string

UnderSQL is resource.PathUnder as a SQL predicate over two text expressions: path is the column or parameter tested, folder the one it must lie beneath, by path segment. The grants, the folder moves that rewrite them and a site's media mounts all read it, so the Go check and the SQL agree.

Types

type Grantee

type Grantee struct {
	Subject string
	Email   string
	// Personas is every persona the person's roles reach, the membership a
	// persona library is read by: a grant to any of them covers the person.
	Personas []string
}

Grantee is who a grant lookup is for: the person by subject and address, and every persona their roles reach.

type Source

type Source interface {
	WritableFolders(ctx context.Context, g Grantee) ([]string, error)
}

Source answers the Global folders a grantee holds a write grant on.

func Installed

func Installed() Source

Installed is the source in force, nil for none: nobody holds a grant.

Jump to

Keyboard shortcuts

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