Documentation
¶
Overview ¶
Package permissionpersist persists permission grants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteGrant ¶
func DeleteGrant(ui tui.NoticeRenderer, folderSettingsPath, globalSettingsPath string, entry permissions.PermissionEntry) error
DeleteGrant removes a persisted permission grant from the settings file chosen by its grant kind, through the shared config.Persist chokepoint — the same sidecar lock, re-read-validate, and atomic replace a grant write takes. It is the persistence half of a revoke: the revoke seam binds it with the real folder/global settings paths so the grant-kind→file routing lives in one place and is not duplicated at the call site (mirroring how persistGrant selects the file for a write).
A folder grant is removed from folderSettingsPath; a global grant from globalSettingsPath. A session grant is never persisted (the on-disk parser rejects session grants), so it is skipped with no file write and a nil error; dropping it from the in-memory cache is the caller's responsibility. Removing an entry that is absent from the target file is itself a clean no-op inside config.Persist. The returned error is config.Persist's, surfaced so the caller can render a notice.
func PersistGrantReportingCreate ¶
func PersistGrantReportingCreate(store *sessions.Store, ui tui.NoticeRenderer, targetPath, requestPath string, entry permissions.PermissionEntry) (permissions.PermissionEntry, bool, error)
The created report is derived from a stat taken before the write, outside config.Persist's lock window, so two processes creating the file at once may both report it.
Types ¶
This section is empty.