mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Show usage banners in doc menu of free team sites
Summary: Also fixes a minor CSS regression in UserManager where the link to add a team member wasn't shown on a separate row. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3444
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import {Organization} from 'app/common/UserAPI';
|
||||
|
||||
export const OWNER = 'owners';
|
||||
export const EDITOR = 'editors';
|
||||
export const VIEWER = 'viewers';
|
||||
@@ -39,6 +41,15 @@ export function canView(role: string|null): boolean {
|
||||
return role !== null;
|
||||
}
|
||||
|
||||
export function isOwner(resource: {access: Role}|null): resource is {access: Role} {
|
||||
return resource?.access === OWNER;
|
||||
}
|
||||
|
||||
export function canUpgradeOrg(org: Organization|null): org is Organization {
|
||||
// TODO: Need to consider billing managers and support user.
|
||||
return isOwner(org);
|
||||
}
|
||||
|
||||
// Returns true if the role string is a valid role or null.
|
||||
export function isValidRole(role: string|null): role is Role|null {
|
||||
return (roleOrder as Array<string|null>).includes(role);
|
||||
|
||||
Reference in New Issue
Block a user