grantsource

package
v1.169.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 3 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 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