Skip to content

Commit db02459

Browse files
committed
feat: configurable hide grant access tools (#2829)
1 parent 4ddfc9e commit db02459

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/store/reducers/capabilities/hooks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type {Capability, MetaCapability, SecuritySetting} from '../../../types/api/capabilities';
2+
import {uiFactory} from '../../../uiFactory/uiFactory';
23
import {useTypedSelector} from '../../../utils/hooks';
34
import {useDatabaseFromQuery} from '../../../utils/hooks/useDatabaseFromQuery';
45

@@ -87,7 +88,7 @@ export const useStreamingAvailable = () => {
8788
return useGetFeatureVersion('/viewer/query') >= 8;
8889
};
8990
export const useEditAccessAvailable = () => {
90-
return useGetFeatureVersion('/viewer/acl') >= 2;
91+
return useGetFeatureVersion('/viewer/acl') >= 2 && !uiFactory.hideGrantAccess;
9192
};
9293

9394
export const useTopicDataAvailable = () => {

src/uiFactory/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface UIFactory<H extends string = CommonIssueType> {
4141
countHealthcheckIssuesByType: (issueTrees: IssuesTree[]) => Record<H, number>;
4242
};
4343
hasAccess?: boolean;
44+
hideGrantAccess?: boolean;
4445
yaMetricaMap?: Record<string, number>;
4546

4647
useDatabaseId?: boolean;

0 commit comments

Comments
 (0)