mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add a Users dropdown to AccessRules page.
Summary: The list of users allows copying users' emails to clipboard, and viewing the doc as that user. Test Plan: Added a basic test case Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2711
This commit is contained in:
@@ -154,6 +154,14 @@ export interface UserAccessData {
|
||||
parentAccess?: roles.BasicRole|null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combines access, parentAccess, and maxInheritedRole info into the resulting access role.
|
||||
*/
|
||||
export function getRealAccess(user: UserAccessData, permissionData: PermissionData): roles.Role|null {
|
||||
const inheritedAccess = roles.getWeakestRole(user.parentAccess || null, permissionData.maxInheritedRole || null);
|
||||
return roles.getStrongestRole(user.access, inheritedAccess);
|
||||
}
|
||||
|
||||
export interface ActiveSessionInfo {
|
||||
user: FullUser & {helpScoutSignature?: string};
|
||||
org: Organization|null;
|
||||
|
||||
Reference in New Issue
Block a user