@commercetools-frontend/permissions 20.9.3 → 20.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-permissions.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-permissions.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-permissions.esm.js +1 -1
- package/dist/declarations/src/components/authorized/authorized.d.ts +50 -50
- package/dist/declarations/src/components/authorized/index.d.ts +2 -2
- package/dist/declarations/src/components/branch-on-permissions/branch-on-permissions.d.ts +24 -24
- package/dist/declarations/src/components/branch-on-permissions/index.d.ts +1 -1
- package/dist/declarations/src/components/restricted-by-permissions/index.d.ts +1 -1
- package/dist/declarations/src/components/restricted-by-permissions/restricted-by-permissions.d.ts +41 -41
- package/dist/declarations/src/hooks/use-is-authorized/index.d.ts +1 -1
- package/dist/declarations/src/hooks/use-is-authorized/use-is-authorized.d.ts +30 -30
- package/dist/declarations/src/index.d.ts +6 -6
- package/dist/declarations/src/utils/get-display-name.d.ts +3 -3
- package/dist/declarations/src/utils/has-permissions.d.ts +49 -49
- package/dist/declarations/src/version.d.ts +2 -2
- package/package.json +7 -7
|
@@ -53,7 +53,7 @@ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
|
53
53
|
var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
|
|
54
54
|
|
|
55
55
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
56
|
-
var version = '20.
|
|
56
|
+
var version = '20.10.4';
|
|
57
57
|
|
|
58
58
|
// Build the permission key from the definition to match it to the format coming from the API.
|
|
59
59
|
var toCanCase = function toCanCase(permissionName) {
|
|
@@ -52,7 +52,7 @@ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
|
52
52
|
var upperFirst__default = /*#__PURE__*/_interopDefault(upperFirst);
|
|
53
53
|
|
|
54
54
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
55
|
-
var version = '20.
|
|
55
|
+
var version = '20.10.4';
|
|
56
56
|
|
|
57
57
|
// Build the permission key from the definition to match it to the format coming from the API.
|
|
58
58
|
var toCanCase = function toCanCase(permissionName) {
|
|
@@ -26,7 +26,7 @@ import upperFirst from 'lodash/upperFirst';
|
|
|
26
26
|
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
27
27
|
|
|
28
28
|
// NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
|
|
29
|
-
var version = '20.
|
|
29
|
+
var version = '20.10.4';
|
|
30
30
|
|
|
31
31
|
// Build the permission key from the definition to match it to the format coming from the API.
|
|
32
32
|
var toCanCase = function toCanCase(permissionName) {
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
-
import { ComponentType, ReactNode } from 'react';
|
|
3
|
-
declare type TPermissionName = string;
|
|
4
|
-
declare type TActionRightName = string;
|
|
5
|
-
declare type TActionRightGroup = string;
|
|
6
|
-
declare type TDemandedActionRight = {
|
|
7
|
-
group: TActionRightGroup;
|
|
8
|
-
name: TActionRightName;
|
|
9
|
-
};
|
|
10
|
-
declare type TDemandedDataFence = {
|
|
11
|
-
group: string;
|
|
12
|
-
name: string;
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
|
-
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
16
|
-
actualDataFenceValues: string[];
|
|
17
|
-
}) => string[] | null;
|
|
18
|
-
declare type TProjectPermissions = {
|
|
19
|
-
permissions: TNormalizedPermissions | null;
|
|
20
|
-
actionRights: TNormalizedActionRights | null;
|
|
21
|
-
dataFences: TNormalizedDataFences | null;
|
|
22
|
-
};
|
|
23
|
-
declare type Props = {
|
|
24
|
-
demandedPermissions: TPermissionName[];
|
|
25
|
-
demandedActionRights?: TDemandedActionRight[];
|
|
26
|
-
demandedDataFences?: TDemandedDataFence[];
|
|
27
|
-
shouldMatchSomePermissions?: boolean;
|
|
28
|
-
selectDataFenceData?: TSelectDataFenceData;
|
|
29
|
-
projectPermissions?: TProjectPermissions;
|
|
30
|
-
render: (isAuthorized: boolean) => ReactNode;
|
|
31
|
-
children?: never;
|
|
32
|
-
};
|
|
33
|
-
declare const Authorized: {
|
|
34
|
-
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
|
-
displayName: string;
|
|
36
|
-
defaultProps: Pick<Props, "shouldMatchSomePermissions">;
|
|
37
|
-
};
|
|
38
|
-
declare type TInjectAuthorizedOptions<OwnProps extends {}> = {
|
|
39
|
-
shouldMatchSomePermissions?: boolean;
|
|
40
|
-
actionRights?: TDemandedActionRight[];
|
|
41
|
-
dataFences?: TDemandedDataFence[];
|
|
42
|
-
getSelectDataFenceData?: (ownProps: OwnProps) => TSelectDataFenceData;
|
|
43
|
-
};
|
|
44
|
-
declare const injectAuthorized: <OwnProps extends {
|
|
45
|
-
isAuthorized?: boolean | undefined;
|
|
46
|
-
}, InjectedProps extends OwnProps & {
|
|
47
|
-
[key: string]: boolean;
|
|
48
|
-
}>(demandedPermissions: TPermissionName[], options?: TInjectAuthorizedOptions<OwnProps>, propName?: string) => (Component: ComponentType<OwnProps>) => ComponentType<OwnProps & InjectedProps>;
|
|
49
|
-
export default Authorized;
|
|
50
|
-
export { injectAuthorized };
|
|
1
|
+
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
declare type TPermissionName = string;
|
|
4
|
+
declare type TActionRightName = string;
|
|
5
|
+
declare type TActionRightGroup = string;
|
|
6
|
+
declare type TDemandedActionRight = {
|
|
7
|
+
group: TActionRightGroup;
|
|
8
|
+
name: TActionRightName;
|
|
9
|
+
};
|
|
10
|
+
declare type TDemandedDataFence = {
|
|
11
|
+
group: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
16
|
+
actualDataFenceValues: string[];
|
|
17
|
+
}) => string[] | null;
|
|
18
|
+
declare type TProjectPermissions = {
|
|
19
|
+
permissions: TNormalizedPermissions | null;
|
|
20
|
+
actionRights: TNormalizedActionRights | null;
|
|
21
|
+
dataFences: TNormalizedDataFences | null;
|
|
22
|
+
};
|
|
23
|
+
declare type Props = {
|
|
24
|
+
demandedPermissions: TPermissionName[];
|
|
25
|
+
demandedActionRights?: TDemandedActionRight[];
|
|
26
|
+
demandedDataFences?: TDemandedDataFence[];
|
|
27
|
+
shouldMatchSomePermissions?: boolean;
|
|
28
|
+
selectDataFenceData?: TSelectDataFenceData;
|
|
29
|
+
projectPermissions?: TProjectPermissions;
|
|
30
|
+
render: (isAuthorized: boolean) => ReactNode;
|
|
31
|
+
children?: never;
|
|
32
|
+
};
|
|
33
|
+
declare const Authorized: {
|
|
34
|
+
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
defaultProps: Pick<Props, "shouldMatchSomePermissions">;
|
|
37
|
+
};
|
|
38
|
+
declare type TInjectAuthorizedOptions<OwnProps extends {}> = {
|
|
39
|
+
shouldMatchSomePermissions?: boolean;
|
|
40
|
+
actionRights?: TDemandedActionRight[];
|
|
41
|
+
dataFences?: TDemandedDataFence[];
|
|
42
|
+
getSelectDataFenceData?: (ownProps: OwnProps) => TSelectDataFenceData;
|
|
43
|
+
};
|
|
44
|
+
declare const injectAuthorized: <OwnProps extends {
|
|
45
|
+
isAuthorized?: boolean | undefined;
|
|
46
|
+
}, InjectedProps extends OwnProps & {
|
|
47
|
+
[key: string]: boolean;
|
|
48
|
+
}>(demandedPermissions: TPermissionName[], options?: TInjectAuthorizedOptions<OwnProps>, propName?: string) => (Component: ComponentType<OwnProps>) => ComponentType<OwnProps & InjectedProps>;
|
|
49
|
+
export default Authorized;
|
|
50
|
+
export { injectAuthorized };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './authorized';
|
|
2
|
-
export { injectAuthorized } from './authorized';
|
|
1
|
+
export { default } from './authorized';
|
|
2
|
+
export { injectAuthorized } from './authorized';
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
declare type TPermissionName = string;
|
|
3
|
-
declare type TActionRightName = string;
|
|
4
|
-
declare type TActionRightGroup = string;
|
|
5
|
-
declare type TDemandedActionRight = {
|
|
6
|
-
group: TActionRightGroup;
|
|
7
|
-
name: TActionRightName;
|
|
8
|
-
};
|
|
9
|
-
declare type TDemandedDataFence = {
|
|
10
|
-
group: string;
|
|
11
|
-
name: string;
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
15
|
-
actualDataFenceValues: string[];
|
|
16
|
-
}) => string[] | null;
|
|
17
|
-
declare type TOptions<OwnProps extends {}> = {
|
|
18
|
-
shouldMatchSomePermissions?: boolean;
|
|
19
|
-
actionRights?: TDemandedActionRight[];
|
|
20
|
-
dataFences?: TDemandedDataFence[];
|
|
21
|
-
getSelectDataFenceData?: (ownProps: OwnProps) => TSelectDataFenceData;
|
|
22
|
-
};
|
|
23
|
-
declare const branchOnPermissions: <OwnProps extends {}>(demandedPermissions: TPermissionName[], FallbackComponent: ComponentType<unknown>, options?: TOptions<OwnProps>) => (Component: ComponentType<OwnProps>) => ComponentType<OwnProps>;
|
|
24
|
-
export default branchOnPermissions;
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
declare type TPermissionName = string;
|
|
3
|
+
declare type TActionRightName = string;
|
|
4
|
+
declare type TActionRightGroup = string;
|
|
5
|
+
declare type TDemandedActionRight = {
|
|
6
|
+
group: TActionRightGroup;
|
|
7
|
+
name: TActionRightName;
|
|
8
|
+
};
|
|
9
|
+
declare type TDemandedDataFence = {
|
|
10
|
+
group: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
15
|
+
actualDataFenceValues: string[];
|
|
16
|
+
}) => string[] | null;
|
|
17
|
+
declare type TOptions<OwnProps extends {}> = {
|
|
18
|
+
shouldMatchSomePermissions?: boolean;
|
|
19
|
+
actionRights?: TDemandedActionRight[];
|
|
20
|
+
dataFences?: TDemandedDataFence[];
|
|
21
|
+
getSelectDataFenceData?: (ownProps: OwnProps) => TSelectDataFenceData;
|
|
22
|
+
};
|
|
23
|
+
declare const branchOnPermissions: <OwnProps extends {}>(demandedPermissions: TPermissionName[], FallbackComponent: ComponentType<unknown>, options?: TOptions<OwnProps>) => (Component: ComponentType<OwnProps>) => ComponentType<OwnProps>;
|
|
24
|
+
export default branchOnPermissions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './branch-on-permissions';
|
|
1
|
+
export { default } from './branch-on-permissions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './restricted-by-permissions';
|
|
1
|
+
export { default } from './restricted-by-permissions';
|
package/dist/declarations/src/components/restricted-by-permissions/restricted-by-permissions.d.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
-
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
declare type TPermissionName = string;
|
|
4
|
-
declare type TActionRightName = string;
|
|
5
|
-
declare type TActionRightGroup = string;
|
|
6
|
-
declare type TDemandedActionRight = {
|
|
7
|
-
group: TActionRightGroup;
|
|
8
|
-
name: TActionRightName;
|
|
9
|
-
};
|
|
10
|
-
declare type TDemandedDataFence = {
|
|
11
|
-
group: string;
|
|
12
|
-
name: string;
|
|
13
|
-
type: string;
|
|
14
|
-
};
|
|
15
|
-
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
16
|
-
actualDataFenceValues: string[];
|
|
17
|
-
}) => string[] | null;
|
|
18
|
-
declare type TProjectPermissions = {
|
|
19
|
-
permissions: TNormalizedPermissions | null;
|
|
20
|
-
actionRights: TNormalizedActionRights | null;
|
|
21
|
-
dataFences: TNormalizedDataFences | null;
|
|
22
|
-
};
|
|
23
|
-
declare type TRenderProp = (props: {
|
|
24
|
-
isAuthorized: boolean;
|
|
25
|
-
}) => ReactNode;
|
|
26
|
-
declare type Props = {
|
|
27
|
-
shouldMatchSomePermissions?: boolean;
|
|
28
|
-
permissions: TPermissionName[];
|
|
29
|
-
actionRights?: TDemandedActionRight[];
|
|
30
|
-
dataFences?: TDemandedDataFence[];
|
|
31
|
-
selectDataFenceData?: TSelectDataFenceData;
|
|
32
|
-
unauthorizedComponent?: ComponentType;
|
|
33
|
-
projectPermissions?: TProjectPermissions;
|
|
34
|
-
render?: TRenderProp;
|
|
35
|
-
children?: TRenderProp | ReactNode;
|
|
36
|
-
};
|
|
37
|
-
declare const RestrictedByPermissions: {
|
|
38
|
-
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
-
displayName: string;
|
|
40
|
-
};
|
|
41
|
-
export default RestrictedByPermissions;
|
|
1
|
+
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
+
import { ReactNode, ComponentType } from 'react';
|
|
3
|
+
declare type TPermissionName = string;
|
|
4
|
+
declare type TActionRightName = string;
|
|
5
|
+
declare type TActionRightGroup = string;
|
|
6
|
+
declare type TDemandedActionRight = {
|
|
7
|
+
group: TActionRightGroup;
|
|
8
|
+
name: TActionRightName;
|
|
9
|
+
};
|
|
10
|
+
declare type TDemandedDataFence = {
|
|
11
|
+
group: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
16
|
+
actualDataFenceValues: string[];
|
|
17
|
+
}) => string[] | null;
|
|
18
|
+
declare type TProjectPermissions = {
|
|
19
|
+
permissions: TNormalizedPermissions | null;
|
|
20
|
+
actionRights: TNormalizedActionRights | null;
|
|
21
|
+
dataFences: TNormalizedDataFences | null;
|
|
22
|
+
};
|
|
23
|
+
declare type TRenderProp = (props: {
|
|
24
|
+
isAuthorized: boolean;
|
|
25
|
+
}) => ReactNode;
|
|
26
|
+
declare type Props = {
|
|
27
|
+
shouldMatchSomePermissions?: boolean;
|
|
28
|
+
permissions: TPermissionName[];
|
|
29
|
+
actionRights?: TDemandedActionRight[];
|
|
30
|
+
dataFences?: TDemandedDataFence[];
|
|
31
|
+
selectDataFenceData?: TSelectDataFenceData;
|
|
32
|
+
unauthorizedComponent?: ComponentType;
|
|
33
|
+
projectPermissions?: TProjectPermissions;
|
|
34
|
+
render?: TRenderProp;
|
|
35
|
+
children?: TRenderProp | ReactNode;
|
|
36
|
+
};
|
|
37
|
+
declare const RestrictedByPermissions: {
|
|
38
|
+
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
export default RestrictedByPermissions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './use-is-authorized';
|
|
1
|
+
export { default } from './use-is-authorized';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
-
declare type TPermissionName = string;
|
|
3
|
-
declare type TActionRightName = string;
|
|
4
|
-
declare type TActionRightGroup = string;
|
|
5
|
-
declare type TDemandedActionRight = {
|
|
6
|
-
group: TActionRightGroup;
|
|
7
|
-
name: TActionRightName;
|
|
8
|
-
};
|
|
9
|
-
declare type TDemandedDataFence = {
|
|
10
|
-
group: string;
|
|
11
|
-
name: string;
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
15
|
-
actualDataFenceValues: string[];
|
|
16
|
-
}) => string[] | null;
|
|
17
|
-
declare type TProjectPermissions = {
|
|
18
|
-
permissions: TNormalizedPermissions | null;
|
|
19
|
-
actionRights: TNormalizedActionRights | null;
|
|
20
|
-
dataFences: TNormalizedDataFences | null;
|
|
21
|
-
};
|
|
22
|
-
declare const useIsAuthorized: ({ demandedPermissions, demandedActionRights, demandedDataFences, selectDataFenceData, shouldMatchSomePermissions, projectPermissions, }: {
|
|
23
|
-
demandedPermissions: TPermissionName[];
|
|
24
|
-
demandedActionRights?: TDemandedActionRight[] | undefined;
|
|
25
|
-
demandedDataFences?: TDemandedDataFence[] | undefined;
|
|
26
|
-
selectDataFenceData?: TSelectDataFenceData | undefined;
|
|
27
|
-
shouldMatchSomePermissions?: boolean | undefined;
|
|
28
|
-
projectPermissions?: TProjectPermissions | undefined;
|
|
29
|
-
}) => boolean;
|
|
30
|
-
export default useIsAuthorized;
|
|
1
|
+
import type { TNormalizedPermissions, TNormalizedActionRights, TNormalizedDataFences } from '@commercetools-frontend/application-shell-connectors';
|
|
2
|
+
declare type TPermissionName = string;
|
|
3
|
+
declare type TActionRightName = string;
|
|
4
|
+
declare type TActionRightGroup = string;
|
|
5
|
+
declare type TDemandedActionRight = {
|
|
6
|
+
group: TActionRightGroup;
|
|
7
|
+
name: TActionRightName;
|
|
8
|
+
};
|
|
9
|
+
declare type TDemandedDataFence = {
|
|
10
|
+
group: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFence & {
|
|
15
|
+
actualDataFenceValues: string[];
|
|
16
|
+
}) => string[] | null;
|
|
17
|
+
declare type TProjectPermissions = {
|
|
18
|
+
permissions: TNormalizedPermissions | null;
|
|
19
|
+
actionRights: TNormalizedActionRights | null;
|
|
20
|
+
dataFences: TNormalizedDataFences | null;
|
|
21
|
+
};
|
|
22
|
+
declare const useIsAuthorized: ({ demandedPermissions, demandedActionRights, demandedDataFences, selectDataFenceData, shouldMatchSomePermissions, projectPermissions, }: {
|
|
23
|
+
demandedPermissions: TPermissionName[];
|
|
24
|
+
demandedActionRights?: TDemandedActionRight[] | undefined;
|
|
25
|
+
demandedDataFences?: TDemandedDataFence[] | undefined;
|
|
26
|
+
selectDataFenceData?: TSelectDataFenceData | undefined;
|
|
27
|
+
shouldMatchSomePermissions?: boolean | undefined;
|
|
28
|
+
projectPermissions?: TProjectPermissions | undefined;
|
|
29
|
+
}) => boolean;
|
|
30
|
+
export default useIsAuthorized;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as version } from './version';
|
|
2
|
-
export { default as RestrictedByPermissions } from './components/restricted-by-permissions';
|
|
3
|
-
export { default as branchOnPermissions } from './components/branch-on-permissions';
|
|
4
|
-
export { default as Authorized, injectAuthorized, } from './components/authorized';
|
|
5
|
-
export { default as useIsAuthorized } from './hooks/use-is-authorized';
|
|
6
|
-
export { hasEveryPermissions, hasSomePermissions, } from './utils/has-permissions';
|
|
1
|
+
export { default as version } from './version';
|
|
2
|
+
export { default as RestrictedByPermissions } from './components/restricted-by-permissions';
|
|
3
|
+
export { default as branchOnPermissions } from './components/branch-on-permissions';
|
|
4
|
+
export { default as Authorized, injectAuthorized, } from './components/authorized';
|
|
5
|
+
export { default as useIsAuthorized } from './hooks/use-is-authorized';
|
|
6
|
+
export { hasEveryPermissions, hasSomePermissions, } from './utils/has-permissions';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const getDisplayName: <Props extends {}>(Component: import("react").ComponentType<Props>) => string | undefined;
|
|
3
|
-
export default getDisplayName;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const getDisplayName: <Props extends {}>(Component: import("react").ComponentType<Props>) => string | undefined;
|
|
3
|
+
export default getDisplayName;
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
declare type TPermissionName = string;
|
|
2
|
-
declare type TPermissions = {
|
|
3
|
-
[key: string]: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare type TActionRightName = string;
|
|
6
|
-
declare type TActionRightGroup = string;
|
|
7
|
-
declare type TDemandedActionRight = {
|
|
8
|
-
group: TActionRightGroup;
|
|
9
|
-
name: TActionRightName;
|
|
10
|
-
};
|
|
11
|
-
declare type TActionRight = {
|
|
12
|
-
[key: string]: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare type TActionRights = {
|
|
15
|
-
[key: string]: TActionRight;
|
|
16
|
-
};
|
|
17
|
-
declare type TDataFenceGroupedByPermission = {
|
|
18
|
-
[key: string]: {
|
|
19
|
-
values: string[];
|
|
20
|
-
} | null;
|
|
21
|
-
};
|
|
22
|
-
declare type TDataFenceGroupedByResourceType = {
|
|
23
|
-
[key: string]: TDataFenceGroupedByPermission | null;
|
|
24
|
-
};
|
|
25
|
-
declare type TDataFenceType = 'store';
|
|
26
|
-
declare type TDataFences = Partial<Record<TDataFenceType, TDataFenceGroupedByResourceType>>;
|
|
27
|
-
declare type TDemandedDataFence = {
|
|
28
|
-
group: string;
|
|
29
|
-
name: string;
|
|
30
|
-
type: string;
|
|
31
|
-
};
|
|
32
|
-
declare type TDemandedDataFenceWithValues = TDemandedDataFence & {
|
|
33
|
-
actualDataFenceValues: string[];
|
|
34
|
-
};
|
|
35
|
-
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFenceWithValues) => string[] | null;
|
|
36
|
-
declare type TOptionsForAppliedDataFence = {
|
|
37
|
-
actualPermissions: TPermissions | null;
|
|
38
|
-
demandedDataFences: TDemandedDataFence[];
|
|
39
|
-
actualDataFences: TDataFences | null;
|
|
40
|
-
selectDataFenceData?: TSelectDataFenceData;
|
|
41
|
-
};
|
|
42
|
-
export declare const getImpliedPermissions: (permissions: TPermissionName[]) => TPermissionName[];
|
|
43
|
-
export declare const hasPermission: (demandedPermission: TPermissionName, actualPermissions: TPermissions | null) => boolean;
|
|
44
|
-
export declare const hasActionRight: (demandedActionRight: TDemandedActionRight, actualActionRights: TActionRights | null) => boolean;
|
|
45
|
-
export declare const hasEveryPermissions: (demandedPermissions: TPermissionName[], actualPermissions: TPermissions | null) => boolean;
|
|
46
|
-
export declare const hasEveryActionRight: (demandedActionRights: TDemandedActionRight[], actualActionRights: TActionRights | null) => boolean;
|
|
47
|
-
export declare const hasSomePermissions: (demandedPermissions: TPermissionName[], actualPermissions: TPermissions | null) => boolean;
|
|
48
|
-
export declare const hasSomeDataFence: (options: TOptionsForAppliedDataFence) => boolean;
|
|
49
|
-
export {};
|
|
1
|
+
declare type TPermissionName = string;
|
|
2
|
+
declare type TPermissions = {
|
|
3
|
+
[key: string]: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare type TActionRightName = string;
|
|
6
|
+
declare type TActionRightGroup = string;
|
|
7
|
+
declare type TDemandedActionRight = {
|
|
8
|
+
group: TActionRightGroup;
|
|
9
|
+
name: TActionRightName;
|
|
10
|
+
};
|
|
11
|
+
declare type TActionRight = {
|
|
12
|
+
[key: string]: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare type TActionRights = {
|
|
15
|
+
[key: string]: TActionRight;
|
|
16
|
+
};
|
|
17
|
+
declare type TDataFenceGroupedByPermission = {
|
|
18
|
+
[key: string]: {
|
|
19
|
+
values: string[];
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
22
|
+
declare type TDataFenceGroupedByResourceType = {
|
|
23
|
+
[key: string]: TDataFenceGroupedByPermission | null;
|
|
24
|
+
};
|
|
25
|
+
declare type TDataFenceType = 'store';
|
|
26
|
+
declare type TDataFences = Partial<Record<TDataFenceType, TDataFenceGroupedByResourceType>>;
|
|
27
|
+
declare type TDemandedDataFence = {
|
|
28
|
+
group: string;
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
declare type TDemandedDataFenceWithValues = TDemandedDataFence & {
|
|
33
|
+
actualDataFenceValues: string[];
|
|
34
|
+
};
|
|
35
|
+
declare type TSelectDataFenceData = (demandedDataFenceWithActualValues: TDemandedDataFenceWithValues) => string[] | null;
|
|
36
|
+
declare type TOptionsForAppliedDataFence = {
|
|
37
|
+
actualPermissions: TPermissions | null;
|
|
38
|
+
demandedDataFences: TDemandedDataFence[];
|
|
39
|
+
actualDataFences: TDataFences | null;
|
|
40
|
+
selectDataFenceData?: TSelectDataFenceData;
|
|
41
|
+
};
|
|
42
|
+
export declare const getImpliedPermissions: (permissions: TPermissionName[]) => TPermissionName[];
|
|
43
|
+
export declare const hasPermission: (demandedPermission: TPermissionName, actualPermissions: TPermissions | null) => boolean;
|
|
44
|
+
export declare const hasActionRight: (demandedActionRight: TDemandedActionRight, actualActionRights: TActionRights | null) => boolean;
|
|
45
|
+
export declare const hasEveryPermissions: (demandedPermissions: TPermissionName[], actualPermissions: TPermissions | null) => boolean;
|
|
46
|
+
export declare const hasEveryActionRight: (demandedActionRights: TDemandedActionRight[], actualActionRights: TActionRights | null) => boolean;
|
|
47
|
+
export declare const hasSomePermissions: (demandedPermissions: TPermissionName[], actualPermissions: TPermissions | null) => boolean;
|
|
48
|
+
export declare const hasSomeDataFence: (options: TOptionsForAppliedDataFence) => boolean;
|
|
49
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "20.
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: "20.10.4";
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/permissions",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.10.4",
|
|
4
4
|
"description": "React components to declaratively handle MC permissions",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"prepare": "./../../scripts/version.js replace"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@babel/runtime": "7.
|
|
26
|
-
"@babel/runtime-corejs3": "7.
|
|
27
|
-
"@commercetools-frontend/application-shell-connectors": "20.
|
|
28
|
-
"@commercetools-frontend/sentry": "20.
|
|
29
|
-
"@emotion/react": "11.
|
|
25
|
+
"@babel/runtime": "7.15.4",
|
|
26
|
+
"@babel/runtime-corejs3": "7.15.4",
|
|
27
|
+
"@commercetools-frontend/application-shell-connectors": "20.10.4",
|
|
28
|
+
"@commercetools-frontend/sentry": "20.10.4",
|
|
29
|
+
"@emotion/react": "11.5.0",
|
|
30
30
|
"@types/lodash": "^4.14.167",
|
|
31
31
|
"@types/prop-types": "^15.7.3",
|
|
32
|
-
"@types/react": "^17.0.
|
|
32
|
+
"@types/react": "^17.0.16",
|
|
33
33
|
"lodash": "4.17.21",
|
|
34
34
|
"prop-types": "15.7.2",
|
|
35
35
|
"tiny-invariant": "1.1.0",
|