mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add 'user' variable to trigger formulas
Summary: The 'user' variable has a similar API to the one from access rules: it contains properties about a user, such as their full name and email address, as well as optional, user-defined attributes that are populated via user attribute tables. Test Plan: Python unit tests. Reviewers: alexmojaki, paulfitz, dsagal Reviewed By: alexmojaki, dsagal Subscribers: paulfitz, dsagal, alexmojaki Differential Revision: https://phab.getgrist.com/D2898
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { PartialPermissionSet } from 'app/common/ACLPermissions';
|
||||
import { CellValue, RowRecord } from 'app/common/DocActions';
|
||||
import { Role } from './roles';
|
||||
|
||||
export interface RuleSet {
|
||||
tableId: '*' | string;
|
||||
@@ -36,7 +37,16 @@ export interface InfoEditor {
|
||||
}
|
||||
|
||||
// Represents user info, which may include properties which are themselves RowRecords.
|
||||
export type UserInfo = Record<string, CellValue|InfoView|Record<string, string>>;
|
||||
export interface UserInfo {
|
||||
Name: string | null;
|
||||
Email: string | null;
|
||||
Access: Role | null;
|
||||
Origin: string | null;
|
||||
LinkKey: Record<string, string | undefined>;
|
||||
UserID: number | null;
|
||||
[attributes: string]: unknown;
|
||||
toJSON(): {[key: string]: any};
|
||||
}
|
||||
|
||||
/**
|
||||
* Input into the AclMatchFunc. Compiled formulas evaluate AclMatchInput to produce a boolean.
|
||||
|
||||
Reference in New Issue
Block a user