@webiny/app-security-access-management 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd

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.
Files changed (89) hide show
  1. package/README.md +5 -3
  2. package/components/GroupAutocomplete/graphql.js +3 -1
  3. package/components/GroupAutocomplete/graphql.js.map +1 -1
  4. package/components/GroupAutocomplete/index.d.ts +2 -2
  5. package/components/GroupAutocomplete/index.js +3 -1
  6. package/components/GroupAutocomplete/index.js.map +1 -1
  7. package/components/GroupsMultiAutocomplete/graphql.js +3 -1
  8. package/components/GroupsMultiAutocomplete/graphql.js.map +1 -1
  9. package/components/GroupsMultiAutocomplete/index.d.ts +2 -2
  10. package/components/GroupsMultiAutocomplete/index.js +3 -1
  11. package/components/GroupsMultiAutocomplete/index.js.map +1 -1
  12. package/components/NotAuthorizedError/NotAuthorizedError.d.ts +2 -2
  13. package/components/NotAuthorizedError/NotAuthorizedError.js +3 -1
  14. package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
  15. package/components/NotAuthorizedError/index.js +3 -1
  16. package/components/NotAuthorizedError/index.js.map +1 -1
  17. package/components/TeamAutocomplete/graphql.js +3 -1
  18. package/components/TeamAutocomplete/graphql.js.map +1 -1
  19. package/components/TeamAutocomplete/index.d.ts +2 -2
  20. package/components/TeamAutocomplete/index.js +3 -1
  21. package/components/TeamAutocomplete/index.js.map +1 -1
  22. package/index.js +3 -2
  23. package/index.js.map +1 -1
  24. package/package.json +18 -19
  25. package/plugins/constants.js +6 -4
  26. package/plugins/constants.js.map +1 -1
  27. package/plugins/index.js +3 -1
  28. package/plugins/index.js.map +1 -1
  29. package/plugins/installation.js +10 -24
  30. package/plugins/installation.js.map +1 -1
  31. package/plugins/permissionRenderer/SecurityPermissions.d.ts +2 -2
  32. package/plugins/permissionRenderer/SecurityPermissions.js +3 -1
  33. package/plugins/permissionRenderer/SecurityPermissions.js.map +1 -1
  34. package/plugins/permissionRenderer/index.js +3 -1
  35. package/plugins/permissionRenderer/index.js.map +1 -1
  36. package/plugins/routes.js +3 -1
  37. package/plugins/routes.js.map +1 -1
  38. package/plugins/secureRouteError.js +3 -1
  39. package/plugins/secureRouteError.js.map +1 -1
  40. package/types.js +3 -1
  41. package/ui/elements/GroupAutocompleteElement.js +3 -1
  42. package/ui/elements/GroupAutocompleteElement.js.map +1 -1
  43. package/ui/elements/GroupsMultiAutocompleteElement.js +3 -1
  44. package/ui/elements/GroupsMultiAutocompleteElement.js.map +1 -1
  45. package/ui/elements/TeamAutocompleteElement.js +3 -1
  46. package/ui/elements/TeamAutocompleteElement.js.map +1 -1
  47. package/ui/views/ApiKeys/ApiKeyForm.d.ts +2 -2
  48. package/ui/views/ApiKeys/ApiKeyForm.js +40 -60
  49. package/ui/views/ApiKeys/ApiKeyForm.js.map +1 -1
  50. package/ui/views/ApiKeys/ApiKeys.d.ts +2 -2
  51. package/ui/views/ApiKeys/ApiKeys.js +3 -1
  52. package/ui/views/ApiKeys/ApiKeys.js.map +1 -1
  53. package/ui/views/ApiKeys/ApiKeysDataList.d.ts +2 -2
  54. package/ui/views/ApiKeys/ApiKeysDataList.js +24 -39
  55. package/ui/views/ApiKeys/ApiKeysDataList.js.map +1 -1
  56. package/ui/views/ApiKeys/graphql.js +3 -1
  57. package/ui/views/ApiKeys/graphql.js.map +1 -1
  58. package/ui/views/ApiKeys/index.js +3 -1
  59. package/ui/views/ApiKeys/index.js.map +1 -1
  60. package/ui/views/ApiKeys/utils.js +5 -3
  61. package/ui/views/ApiKeys/utils.js.map +1 -1
  62. package/ui/views/Groups/Groups.d.ts +2 -2
  63. package/ui/views/Groups/Groups.js +3 -1
  64. package/ui/views/Groups/Groups.js.map +1 -1
  65. package/ui/views/Groups/GroupsDataList.d.ts +2 -2
  66. package/ui/views/Groups/GroupsDataList.js +24 -39
  67. package/ui/views/Groups/GroupsDataList.js.map +1 -1
  68. package/ui/views/Groups/GroupsForm.d.ts +2 -2
  69. package/ui/views/Groups/GroupsForm.js +41 -59
  70. package/ui/views/Groups/GroupsForm.js.map +1 -1
  71. package/ui/views/Groups/graphql.js +3 -1
  72. package/ui/views/Groups/graphql.js.map +1 -1
  73. package/ui/views/Groups/index.js +3 -1
  74. package/ui/views/Groups/index.js.map +1 -1
  75. package/ui/views/Teams/Teams.d.ts +2 -2
  76. package/ui/views/Teams/Teams.js +3 -1
  77. package/ui/views/Teams/Teams.js.map +1 -1
  78. package/ui/views/Teams/TeamsDataList.d.ts +2 -2
  79. package/ui/views/Teams/TeamsDataList.js +24 -39
  80. package/ui/views/Teams/TeamsDataList.js.map +1 -1
  81. package/ui/views/Teams/TeamsForm.d.ts +2 -2
  82. package/ui/views/Teams/TeamsForm.js +31 -46
  83. package/ui/views/Teams/TeamsForm.js.map +1 -1
  84. package/ui/views/Teams/graphql.js +3 -1
  85. package/ui/views/Teams/graphql.js.map +1 -1
  86. package/ui/views/Teams/index.js +3 -1
  87. package/ui/views/Teams/index.js.map +1 -1
  88. package/ui/views/utils.js +3 -1
  89. package/ui/views/utils.js.map +1 -1
package/README.md CHANGED
@@ -66,9 +66,11 @@ Auth.configure({
66
66
  responseType: "token"
67
67
  }
68
68
  });
69
-
69
+ interface AuthenticatorProps {
70
+ children: React.ReactNode;
71
+ }
70
72
  // The `Authenticator` component.
71
- const Authenticator: React.FC = props => {
73
+ const Authenticator = (props: AuthenticatorProps) => {
72
74
  const { setIdentity } = useSecurity();
73
75
 
74
76
  useEffect(() => {
@@ -101,7 +103,7 @@ Finally, use the `useSecurity` React hook in any of your components:
101
103
  import React from "react";
102
104
  import { useSecurity } from "@webiny/app-security";
103
105
 
104
- const MyComponent: React.FC = () => {
106
+ const MyComponent = () => {
105
107
  const { identity } = useSecurity();
106
108
 
107
109
  if (identity) {
@@ -9,4 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
10
10
  var _templateObject;
11
11
  var LIST_GROUPS = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n"])));
12
- exports.LIST_GROUPS = LIST_GROUPS;
12
+ exports.LIST_GROUPS = LIST_GROUPS;
13
+
14
+ //# sourceMappingURL=graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LIST_GROUPS","gql"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAA8B;AAEvB,IAAMA,WAAW,OAAGC,mBAAG,4XAc7B;AAAC"}
1
+ {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","LIST_GROUPS","gql","_taggedTemplateLiteral2","default","exports"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,eAAA;AAEvB,IAAMC,WAAW,OAAGC,mBAAG,EAAAF,eAAA,KAAAA,eAAA,OAAAG,uBAAA,CAAAC,OAAA,iTAc7B;AAACC,OAAA,CAAAJ,WAAA,GAAAA,WAAA"}
@@ -1,5 +1,5 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  import { AutoCompleteProps } from "@webiny/ui/AutoComplete";
3
3
  declare type GroupAutocompleteProps = Partial<AutoCompleteProps>;
4
- export declare const GroupAutocomplete: React.FC<GroupAutocompleteProps>;
4
+ export declare const GroupAutocomplete: (props: GroupAutocompleteProps) => JSX.Element;
5
5
  export {};
@@ -20,4 +20,6 @@ var GroupAutocomplete = function GroupAutocomplete(props) {
20
20
  value: loading ? undefined : props.value
21
21
  }));
22
22
  };
23
- exports.GroupAutocomplete = GroupAutocomplete;
23
+ exports.GroupAutocomplete = GroupAutocomplete;
24
+
25
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GroupAutocomplete","props","useQuery","LIST_GROUPS","data","loading","options","security","groups","undefined","value"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { AutoComplete, AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupAutocompleteProps = Partial<AutoCompleteProps>;\nexport const GroupAutocomplete: React.FC<GroupAutocompleteProps> = props => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAGO,IAAMA,iBAAmD,GAAG,SAAtDA,iBAAmD,CAAGC,KAAK,EAAI;EACxE,gBAA0B,IAAAC,oBAAQ,EAACC,oBAAW,CAAC;IAAvCC,IAAI,aAAJA,IAAI;IAAEC,OAAO,aAAPA,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACI,6BAAC,0BAAY,oBACLH,KAAK;IACT,OAAO,EAAEK,OAAQ;IACjB,SAAS,EAAE,IAAK;IAChB,KAAK,EAAED,OAAO,GAAGI,SAAS,GAAGR,KAAK,CAACS;EAAM,GAC3C;AAEV,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_AutoComplete","_graphql","_reactHooks","GroupAutocomplete","props","_useQuery","useQuery","LIST_GROUPS","data","loading","options","security","groups","default","createElement","AutoComplete","Object","assign","valueProp","value","undefined","exports"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { AutoComplete, AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupAutocompleteProps = Partial<AutoCompleteProps>;\nexport const GroupAutocomplete = (props: GroupAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGO,IAAMI,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,KAA6B,EAAK;EAChE,IAAAC,SAAA,GAA0B,IAAAC,oBAAQ,EAACC,oBAAW,CAAC;IAAvCC,IAAI,GAAAH,SAAA,CAAJG,IAAI;IAAEC,OAAO,GAAAJ,SAAA,CAAPI,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIX,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,aAAA,CAAAe,YAAY,EAAAC,MAAA,CAAAC,MAAA,KACLb,KAAK;IACTM,OAAO,EAAEA,OAAQ;IACjBQ,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAEV,OAAO,GAAGW,SAAS,GAAGhB,KAAK,CAACe;EAAM,EAC5C,CAAC;AAEV,CAAC;AAACE,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA"}
@@ -9,4 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
10
10
  var _templateObject;
11
11
  var LIST_GROUPS = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n"])));
12
- exports.LIST_GROUPS = LIST_GROUPS;
12
+ exports.LIST_GROUPS = LIST_GROUPS;
13
+
14
+ //# sourceMappingURL=graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LIST_GROUPS","gql"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAA8B;AAEvB,IAAMA,WAAW,OAAGC,mBAAG,yfAmB7B;AAAC"}
1
+ {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","LIST_GROUPS","gql","_taggedTemplateLiteral2","default","exports"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_GROUPS = gql`\n query listGroups {\n security {\n groups: listGroups {\n data {\n id\n slug\n name\n description\n createdOn\n }\n error {\n data\n message\n code\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,eAAA;AAEvB,IAAMC,WAAW,OAAGC,mBAAG,EAAAF,eAAA,KAAAA,eAAA,OAAAG,uBAAA,CAAAC,OAAA,8aAmB7B;AAACC,OAAA,CAAAJ,WAAA,GAAAA,WAAA"}
@@ -1,5 +1,5 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  import { MultiAutoCompleteProps } from "@webiny/ui/AutoComplete";
3
3
  declare type GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;
4
- export declare const GroupsMultiAutoComplete: React.FC<GroupsMultiAutocompleteProps>;
4
+ export declare const GroupsMultiAutoComplete: (props: GroupsMultiAutocompleteProps) => JSX.Element;
5
5
  export {};
@@ -21,4 +21,6 @@ var GroupsMultiAutoComplete = function GroupsMultiAutoComplete(props) {
21
21
  value: loading ? undefined : props.value
22
22
  }));
23
23
  };
24
- exports.GroupsMultiAutoComplete = GroupsMultiAutoComplete;
24
+ exports.GroupsMultiAutoComplete = GroupsMultiAutoComplete;
25
+
26
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GroupsMultiAutoComplete","props","useQuery","LIST_GROUPS","data","loading","options","security","groups","undefined","value"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { MultiAutoComplete, MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const GroupsMultiAutoComplete: React.FC<GroupsMultiAutocompleteProps> = props => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAIO,IAAMA,uBAA+D,GAAG,SAAlEA,uBAA+D,CAAGC,KAAK,EAAI;EACpF,gBAA0B,IAAAC,oBAAQ,EAACC,oBAAW,CAAC;IAAvCC,IAAI,aAAJA,IAAI;IAAEC,OAAO,aAAPA,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACI,6BAAC,+BAAiB,oBACVH,KAAK;IACT,OAAO,EAAEK,OAAQ;IACjB,SAAS,EAAE,IAAK;IAChB,MAAM,EAAE,IAAK;IACb,KAAK,EAAED,OAAO,GAAGI,SAAS,GAAGR,KAAK,CAACS;EAAM,GAC3C;AAEV,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_AutoComplete","_graphql","_reactHooks","GroupsMultiAutoComplete","props","_useQuery","useQuery","LIST_GROUPS","data","loading","options","security","groups","default","createElement","MultiAutoComplete","Object","assign","valueProp","unique","value","undefined","exports"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { MultiAutoComplete, MultiAutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_GROUPS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype GroupsMultiAutocompleteProps = Partial<MultiAutoCompleteProps>;\n\nexport const GroupsMultiAutoComplete = (props: GroupsMultiAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_GROUPS);\n\n const options = loading || !data ? [] : data.security.groups.data;\n\n return (\n <MultiAutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n unique={true}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAIO,IAAMI,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,KAAmC,EAAK;EAC5E,IAAAC,SAAA,GAA0B,IAAAC,oBAAQ,EAACC,oBAAW,CAAC;IAAvCC,IAAI,GAAAH,SAAA,CAAJG,IAAI;IAAEC,OAAO,GAAAJ,SAAA,CAAPI,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,MAAM,CAACJ,IAAI;EAEjE,oBACIX,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,aAAA,CAAAe,iBAAiB,EAAAC,MAAA,CAAAC,MAAA,KACVb,KAAK;IACTM,OAAO,EAAEA,OAAQ;IACjBQ,SAAS,EAAE,IAAK;IAChBC,MAAM,EAAE,IAAK;IACbC,KAAK,EAAEX,OAAO,GAAGY,SAAS,GAAGjB,KAAK,CAACgB;EAAM,EAC5C,CAAC;AAEV,CAAC;AAACE,OAAA,CAAAnB,uBAAA,GAAAA,uBAAA"}
@@ -1,2 +1,2 @@
1
- import * as React from "react";
2
- export declare const NotAuthorizedError: React.FC;
1
+ /// <reference types="react" />
2
+ export declare const NotAuthorizedError: () => JSX.Element;
@@ -56,4 +56,6 @@ var NotAuthorizedError = function NotAuthorizedError() {
56
56
  className: styles.linkStyle
57
57
  }, "Take me back."));
58
58
  };
59
- exports.NotAuthorizedError = NotAuthorizedError;
59
+ exports.NotAuthorizedError = NotAuthorizedError;
60
+
61
+ //# sourceMappingURL=NotAuthorizedError.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ContentWrapper","styled","display","paddingTop","textAlign","margin","styles","authErrorImgStyle","css","width","paddingBottom","bodyStyle","color","linkStyle","textDecoration","NotAuthorizedError","authErrorImg"],"sources":["NotAuthorizedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Link } from \"@webiny/react-router\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport Helmet from \"react-helmet\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst ContentWrapper = styled(\"div\")({\n display: \"block\",\n paddingTop: \"15%\",\n textAlign: \"center\",\n margin: \"auto\"\n});\n\nconst styles = {\n authErrorImgStyle: css({\n width: \"192px\",\n paddingBottom: \"24px\"\n }),\n bodyStyle: css({\n color: \"var(--mdc-theme-text-primary-on-background)\",\n display: \"block\"\n }),\n linkStyle: css({\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"none\"\n }\n })\n};\n\nexport const NotAuthorizedError: React.FC = () => {\n return (\n <ContentWrapper>\n <Helmet title={\"Not authorized\"} />\n\n <img className={styles.authErrorImgStyle} src={authErrorImg} alt=\"Not Authorized\" />\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n You are not authorized to view this route.\n </Typography>\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n Please contact your administrator to request access.\n </Typography>\n\n <Link to=\"/\" className={styles.linkStyle}>\n Take me back.\n </Link>\n </ContentWrapper>\n );\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAMA,cAAc,oBAAGC,eAAM,EAAC,KAAK;EAAA;EAAA;AAAA,GAAE;EACjCC,OAAO,EAAE,OAAO;EAChBC,UAAU,EAAE,KAAK;EACjBC,SAAS,EAAE,QAAQ;EACnBC,MAAM,EAAE;AACZ,CAAC,CAAC;AAEF,IAAMC,MAAM,GAAG;EACXC,iBAAiB,eAAE,IAAAC,YAAG,EAAC;IACnBC,KAAK,EAAE,OAAO;IACdC,aAAa,EAAE;EACnB,CAAC,6BAAC;EACFC,SAAS,eAAE,IAAAH,YAAG,EAAC;IACXI,KAAK,EAAE,6CAA6C;IACpDV,OAAO,EAAE;EACb,CAAC,qBAAC;EACFW,SAAS,eAAE,IAAAL,YAAG,EAAC;IACXM,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE;MACPA,cAAc,EAAE;IACpB;EACJ,CAAC;AACL,CAAC;AAEM,IAAMC,kBAA4B,GAAG,SAA/BA,kBAA4B,GAAS;EAC9C,oBACI,oBAAC,cAAc,qBACX,oBAAC,oBAAM;IAAC,KAAK,EAAE;EAAiB,EAAG,eAEnC;IAAK,SAAS,EAAET,MAAM,CAACC,iBAAkB;IAAC,GAAG,EAAES,yBAAa;IAAC,GAAG,EAAC;EAAgB,EAAG,eAEpF,oBAAC,sBAAU;IAAC,GAAG,EAAE,OAAQ;IAAC,SAAS,EAAEV,MAAM,CAACK;EAAU,GAAC,4CAEvD,CAAa,eAEb,oBAAC,sBAAU;IAAC,GAAG,EAAE,OAAQ;IAAC,SAAS,EAAEL,MAAM,CAACK;EAAU,GAAC,sDAEvD,CAAa,eAEb,oBAAC,iBAAI;IAAC,EAAE,EAAC,GAAG;IAAC,SAAS,EAAEL,MAAM,CAACO;EAAU,GAAC,eAE1C,CAAO,CACM;AAEzB,CAAC;AAAC"}
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactRouter","_emotion","_styled","_interopRequireDefault","_reactHelmet","_SecureRouteError","_Typography","ContentWrapper","styled","target","label","display","paddingTop","textAlign","margin","styles","authErrorImgStyle","css","width","paddingBottom","bodyStyle","color","linkStyle","textDecoration","NotAuthorizedError","createElement","default","title","className","src","authErrorImg","alt","Typography","use","Link","to","exports"],"sources":["NotAuthorizedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Link } from \"@webiny/react-router\";\nimport { css } from \"emotion\";\nimport styled from \"@emotion/styled\";\nimport Helmet from \"react-helmet\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst ContentWrapper = styled(\"div\")({\n display: \"block\",\n paddingTop: \"15%\",\n textAlign: \"center\",\n margin: \"auto\"\n});\n\nconst styles = {\n authErrorImgStyle: css({\n width: \"192px\",\n paddingBottom: \"24px\"\n }),\n bodyStyle: css({\n color: \"var(--mdc-theme-text-primary-on-background)\",\n display: \"block\"\n }),\n linkStyle: css({\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"none\"\n }\n })\n};\n\nexport const NotAuthorizedError = () => {\n return (\n <ContentWrapper>\n <Helmet title={\"Not authorized\"} />\n\n <img className={styles.authErrorImgStyle} src={authErrorImg} alt=\"Not Authorized\" />\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n You are not authorized to view this route.\n </Typography>\n\n <Typography use={\"body1\"} className={styles.bodyStyle}>\n Please contact your administrator to request access.\n </Typography>\n\n <Link to=\"/\" className={styles.link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eAEpFlC,KAAA,CAAA4B,aAAA,CAACnB,WAAA,CAAA0B,UAAU;IAACC,GAAG,EAAE,OAAQ;IAACL,SAAS,EAAEb,MAAM,CAACK;EAAU,GAAC,4CAE3C,CAAC,eAEbvB,KAAA,CAAA4B,aAAA,CAACnB,WAAA,CAAA0B,UAAU;IAACC,GAAG,EAAE,OAAQ;IAACL,SAAS,EAAEb,MAAM,CAACK;EAAU,GAAC,sDAE3C,CAAC,eAEbvB,KAAA,CAAA4B,aAAA,CAACzB,YAAA,CAAAkC,IAAI;IAACC,EAAE,EAAC,GAAG;IAACP,SAAS,EAAEb,MAAM,CAACO;EAAU,GAAC,eAEpC,CACM,CAAC;AAEzB,CAAC;AAACc,OAAA,CAAAZ,kBAAA,GAAAA,kBAAA"}
@@ -9,4 +9,6 @@ Object.defineProperty(exports, "NotAuthorizedError", {
9
9
  return _NotAuthorizedError.NotAuthorizedError;
10
10
  }
11
11
  });
12
- var _NotAuthorizedError = require("./NotAuthorizedError");
12
+ var _NotAuthorizedError = require("./NotAuthorizedError");
13
+
14
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":";;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":["_NotAuthorizedError","require"],"sources":["index.ts"],"sourcesContent":["export { NotAuthorizedError } from \"./NotAuthorizedError\";\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA"}
@@ -9,4 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
10
10
  var _templateObject;
11
11
  var LIST_TEAMS = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n"])));
12
- exports.LIST_TEAMS = LIST_TEAMS;
12
+ exports.LIST_TEAMS = LIST_TEAMS;
13
+
14
+ //# sourceMappingURL=graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LIST_TEAMS","gql"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAA8B;AAEvB,IAAMA,UAAU,OAAGC,mBAAG,yXAc5B;AAAC"}
1
+ {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","LIST_TEAMS","gql","_taggedTemplateLiteral2","default","exports"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nexport const LIST_TEAMS = gql`\n query listTeams {\n security {\n teams: listTeams {\n data {\n id\n slug\n name\n description\n createdOn\n }\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,eAAA;AAEvB,IAAMC,UAAU,OAAGC,mBAAG,EAAAF,eAAA,KAAAA,eAAA,OAAAG,uBAAA,CAAAC,OAAA,8SAc5B;AAACC,OAAA,CAAAJ,UAAA,GAAAA,UAAA"}
@@ -1,5 +1,5 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  import { AutoCompleteProps } from "@webiny/ui/AutoComplete";
3
3
  declare type TeamAutocompleteProps = Partial<AutoCompleteProps>;
4
- export declare const TeamAutocomplete: React.FC<TeamAutocompleteProps>;
4
+ export declare const TeamAutocomplete: (props: TeamAutocompleteProps) => JSX.Element;
5
5
  export {};
@@ -20,4 +20,6 @@ var TeamAutocomplete = function TeamAutocomplete(props) {
20
20
  value: loading ? undefined : props.value
21
21
  }));
22
22
  };
23
- exports.TeamAutocomplete = TeamAutocomplete;
23
+ exports.TeamAutocomplete = TeamAutocomplete;
24
+
25
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TeamAutocomplete","props","useQuery","LIST_TEAMS","data","loading","options","security","teams","undefined","value"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { AutoComplete, AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamAutocompleteProps = Partial<AutoCompleteProps>;\nexport const TeamAutocomplete: React.FC<TeamAutocompleteProps> = props => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAGO,IAAMA,gBAAiD,GAAG,SAApDA,gBAAiD,CAAGC,KAAK,EAAI;EACtE,gBAA0B,IAAAC,oBAAQ,EAACC,mBAAU,CAAC;IAAtCC,IAAI,aAAJA,IAAI;IAAEC,OAAO,aAAPA,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACI,6BAAC,0BAAY,oBACLH,KAAK;IACT,OAAO,EAAEK,OAAQ;IACjB,SAAS,EAAE,IAAK;IAChB,KAAK,EAAED,OAAO,GAAGI,SAAS,GAAGR,KAAK,CAACS;EAAM,GAC3C;AAEV,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_AutoComplete","_graphql","_reactHooks","TeamAutocomplete","props","_useQuery","useQuery","LIST_TEAMS","data","loading","options","security","teams","default","createElement","AutoComplete","Object","assign","valueProp","value","undefined","exports"],"sources":["index.tsx"],"sourcesContent":["import React from \"react\";\nimport { AutoComplete, AutoCompleteProps } from \"@webiny/ui/AutoComplete\";\nimport { LIST_TEAMS } from \"./graphql\";\nimport { useQuery } from \"@apollo/react-hooks\";\n\ntype TeamAutocompleteProps = Partial<AutoCompleteProps>;\nexport const TeamAutocomplete = (props: TeamAutocompleteProps) => {\n const { data, loading } = useQuery(LIST_TEAMS);\n\n const options = loading || !data ? [] : data.security.teams.data;\n\n return (\n <AutoComplete\n {...props}\n options={options}\n valueProp={\"id\"}\n value={loading ? undefined : props.value}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGO,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,KAA4B,EAAK;EAC9D,IAAAC,SAAA,GAA0B,IAAAC,oBAAQ,EAACC,mBAAU,CAAC;IAAtCC,IAAI,GAAAH,SAAA,CAAJG,IAAI;IAAEC,OAAO,GAAAJ,SAAA,CAAPI,OAAO;EAErB,IAAMC,OAAO,GAAGD,OAAO,IAAI,CAACD,IAAI,GAAG,EAAE,GAAGA,IAAI,CAACG,QAAQ,CAACC,KAAK,CAACJ,IAAI;EAEhE,oBACIX,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACd,aAAA,CAAAe,YAAY,EAAAC,MAAA,CAAAC,MAAA,KACLb,KAAK;IACTM,OAAO,EAAEA,OAAQ;IACjBQ,SAAS,EAAE,IAAK;IAChBC,KAAK,EAAEV,OAAO,GAAGW,SAAS,GAAGhB,KAAK,CAACe;EAAM,EAC5C,CAAC;AAEV,CAAC;AAACE,OAAA,CAAAlB,gBAAA,GAAAA,gBAAA"}
package/index.js CHANGED
@@ -19,7 +19,6 @@ var _plugins2 = _interopRequireDefault(require("./plugins"));
19
19
  * TODO @ts-refactor
20
20
  * Find out why is there empty default export
21
21
  */
22
- // @ts-ignore
23
22
  var _default = function _default() {
24
23
  return [];
25
24
  };
@@ -83,4 +82,6 @@ var AccessManagementExtension = function AccessManagementExtension() {
83
82
  };
84
83
  exports.AccessManagementExtension = AccessManagementExtension;
85
84
  var AccessManagement = /*#__PURE__*/(0, _react.memo)(AccessManagementExtension);
86
- exports.AccessManagement = AccessManagement;
85
+ exports.AccessManagement = AccessManagement;
86
+
87
+ //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["AccessManagementExtension","plugins","register","accessManagementPlugins","useWcp","getProject","project","teams","package","features","advancedAccessControlLayer","options","Permission","Groups","Teams","ApiKeys","AccessManagement","memo"],"sources":["index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Layout, Plugins, AddMenu, AddRoute, useWcp } from \"@webiny/app-admin\";\nimport { HasPermission } from \"@webiny/app-security\";\nimport { Permission } from \"~/plugins/constants\";\nimport { Groups } from \"~/ui/views/Groups\";\nimport { Teams } from \"~/ui/views/Teams\";\nimport { ApiKeys } from \"~/ui/views/ApiKeys\";\nimport accessManagementPlugins from \"./plugins\";\n\n/**\n * TODO @ts-refactor\n * Find out why is there empty default export\n */\n// @ts-ignore\nexport default () => [];\n\nexport const AccessManagementExtension = () => {\n plugins.register(accessManagementPlugins());\n\n const { getProject } = useWcp();\n\n const project = getProject();\n let teams = false;\n if (project) {\n teams = project.package.features.advancedAccessControlLayer.options.teams;\n }\n\n return (\n <Plugins>\n <HasPermission name={Permission.Groups}>\n <AddRoute exact path={\"/access-management/roles\"}>\n <Layout title={\"Access Management - Roles\"}>\n <Groups />\n </Layout>\n </AddRoute>\n </HasPermission>{\" \"}\n {teams && (\n <HasPermission name={Permission.Teams}>\n <AddRoute exact path={\"/access-management/teams\"}>\n <Layout title={\"Access Management - Teams\"}>\n <Teams />\n </Layout>\n </AddRoute>\n </HasPermission>\n )}\n <HasPermission name={Permission.ApiKeys}>\n <AddRoute exact path={\"/access-management/api-keys\"}>\n <Layout title={\"Access Management - API Keys\"}>\n <ApiKeys />\n </Layout>\n </AddRoute>\n </HasPermission>\n <HasPermission any={[Permission.Groups, Permission.ApiKeys, Permission.Teams]}>\n <AddMenu name={\"settings\"}>\n <AddMenu name={\"settings.accessManagement\"} label={\"Access Management\"}>\n <HasPermission name={Permission.Groups}>\n <AddMenu\n name={\"settings.accessManagement.roles\"}\n label={\"Roles\"}\n path={\"/access-management/roles\"}\n />\n </HasPermission>\n {teams && (\n <HasPermission name={Permission.Teams}>\n <AddMenu\n name={\"settings.accessManagement.teams\"}\n label={\"Teams\"}\n path={\"/access-management/teams\"}\n />\n </HasPermission>\n )}\n\n <HasPermission name={Permission.ApiKeys}>\n <AddMenu\n name={\"settings.accessManagement.apiKeys\"}\n label={\"API Keys\"}\n path={\"/access-management/api-keys\"}\n />\n </HasPermission>\n </AddMenu>\n </AddMenu>\n </HasPermission>\n </Plugins>\n );\n};\n\nexport const AccessManagement = memo(AccessManagementExtension);\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA,eACe;EAAA,OAAM,EAAE;AAAA;AAAA;AAEhB,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyB,GAAS;EAC3CC,gBAAO,CAACC,QAAQ,CAAC,IAAAC,iBAAuB,GAAE,CAAC;EAE3C,cAAuB,IAAAC,gBAAM,GAAE;IAAvBC,UAAU,WAAVA,UAAU;EAElB,IAAMC,OAAO,GAAGD,UAAU,EAAE;EAC5B,IAAIE,KAAK,GAAG,KAAK;EACjB,IAAID,OAAO,EAAE;IACTC,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACC,QAAQ,CAACC,0BAA0B,CAACC,OAAO,CAACJ,KAAK;EAC7E;EAEA,oBACI,6BAAC,iBAAO,qBACJ,6BAAC,0BAAa;IAAC,IAAI,EAAEK,qBAAU,CAACC;EAAO,gBACnC,6BAAC,kBAAQ;IAAC,KAAK;IAAC,IAAI,EAAE;EAA2B,gBAC7C,6BAAC,gBAAM;IAAC,KAAK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I,EAAE;EAA8B,EACtC,CACU,CACV,CACJ,CACE,CACV;AAElB,CAAC;AAAC;AAEK,IAAMC,gBAAgB,gBAAG,IAAAC,WAAI,EAACjB,yBAAyB,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_plugins","_appAdmin","_appSecurity","_constants","_Groups","_Teams","_ApiKeys","_plugins2","_interopRequireDefault","_default","exports","default","AccessManagementExtension","plugins","register","accessManagementPlugins","_useWcp","useWcp","getProject","project","teams","package","features","advancedAccessControlLayer","options","createElement","Plugins","HasPermission","name","Permission","Groups","AddRoute","exact","path","Layout","title","Teams","ApiKeys","any","AddMenu","label","AccessManagement","memo"],"sources":["index.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AddMenu, AddRoute, Layout, Plugins, useWcp } from \"@webiny/app-admin\";\nimport { HasPermission } from \"@webiny/app-security\";\nimport { Permission } from \"~/plugins/constants\";\nimport { Groups } from \"~/ui/views/Groups\";\nimport { Teams } from \"~/ui/views/Teams\";\nimport { ApiKeys } from \"~/ui/views/ApiKeys\";\nimport accessManagementPlugins from \"./plugins\";\n\n/**\n * TODO @ts-refactor\n * Find out why is there empty default export\n */\nexport default () => [];\n\nexport const AccessManagementExtension = () => {\n plugins.register(accessManagementPlugins());\n\n const { getProject } = useWcp();\n\n const project = getProject();\n let teams = false;\n if (project) {\n teams = project.package.features.advancedAccessControlLayer.options.teams;\n }\n\n return (\n <Plugins>\n <HasPermission name={Permission.Groups}>\n <AddRoute exact path={\"/access-management/roles\"}>\n <Layout title={\"Access Management - Roles\"}>\n <Groups />\n </Layout>\n </AddRoute>\n </HasPermission>{\" \"}\n {teams && (\n <HasPermission name={Permission.Teams}>\n <AddRoute exact path={\"/access-management/teams\"}>\n <Layout title={\"Access Management - Teams\"}>\n <Teams />\n </Layout>\n </AddRoute>\n </HasPermission>\n )}\n <HasPermission name={Permission.ApiKeys}>\n <AddRoute exact path={\"/access-management/api-keys\"}>\n <Layout title={\"Access Management - API Keys\"}>\n <ApiKeys />\n </Layout>\n </AddRoute>\n </HasPermission>\n <HasPermission any={[Permission.Groups, Permission.ApiKeys, Permission.Teams]}>\n <AddMenu name={\"settings\"}>\n <AddMenu name={\"settings.accessManagement\"} label={\"Access Management\"}>\n <HasPermission name={Permission.Groups}>\n <AddMenu\n name={\"settings.accessManagement.roles\"}\n label={\"Roles\"}\n path={\"/access-management/roles\"}\n />\n </HasPermission>\n {teams && (\n <HasPermission name={Permission.Teams}>\n <AddMenu\n name={\"settings.accessManagement.teams\"}\n label={\"Teams\"}\n path={\"/access-management/teams\"}\n />\n </HasPermission>\n )}\n\n <HasPermission name={Permission.ApiKeys}>\n <AddMenu\n name={\"settings.accessManagement.apiKeys\"}\n label={\"API Keys\"}\n path={\"/access-management/api-keys\"}\n />\n </HasPermission>\n </AddMenu>\n </AddMenu>\n </HasPermission>\n </Plugins>\n );\n};\n\nexport const AccessManagement = memo(AccessManagementExtension);\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAC,sBAAA,CAAAT,OAAA;AAEA;AACA;AACA;AACA;AAHA,IAAAU,QAAA,GAIe,SAAAA,SAAA;EAAA,OAAM,EAAE;AAAA;AAAAC,OAAA,CAAAC,OAAA,GAAAF,QAAA;AAEhB,IAAMG,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAS;EAC3CC,gBAAO,CAACC,QAAQ,CAAC,IAAAC,iBAAuB,EAAC,CAAC,CAAC;EAE3C,IAAAC,OAAA,GAAuB,IAAAC,gBAAM,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K,EAAE,OAAQ;IACfP,IAAI,EAAE;EAA2B,CACpC,CACU,CAClB,eAEDpC,MAAA,CAAAc,OAAA,CAAAc,aAAA,CAACvB,YAAA,CAAAyB,aAAa;IAACC,IAAI,EAAEC,qBAAU,CAACQ;EAAQ,gBACpCxC,MAAA,CAAAc,OAAA,CAAAc,aAAA,CAACxB,SAAA,CAAAsC,OAAO;IACJX,IAAI,EAAE,mCAAoC;IAC1CY,KAAK,EAAE,UAAW;IAClBP,IAAI,EAAE;EAA8B,CACvC,CACU,CACV,CACJ,CACE,CACV,CAAC;AAElB,CAAC;AAACvB,OAAA,CAAAE,yBAAA,GAAAA,yBAAA;AAEK,IAAM6B,gBAAgB,gBAAG,IAAAC,WAAI,EAAC9B,yBAAyB,CAAC;AAACF,OAAA,CAAA+B,gBAAA,GAAAA,gBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-security-access-management",
3
- "version": "0.0.0-unstable.99666aeb00",
3
+ "version": "0.0.0-unstable.a9593f74dd",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,15 +16,15 @@
16
16
  "@apollo/react-hooks": "3.1.5",
17
17
  "@emotion/styled": "11.10.6",
18
18
  "@material-design-icons/svg": "0.12.1",
19
- "@webiny/app": "0.0.0-unstable.99666aeb00",
20
- "@webiny/app-admin": "0.0.0-unstable.99666aeb00",
21
- "@webiny/app-security": "0.0.0-unstable.99666aeb00",
22
- "@webiny/feature-flags": "0.0.0-unstable.99666aeb00",
23
- "@webiny/form": "0.0.0-unstable.99666aeb00",
24
- "@webiny/plugins": "0.0.0-unstable.99666aeb00",
25
- "@webiny/react-router": "0.0.0-unstable.99666aeb00",
26
- "@webiny/ui": "0.0.0-unstable.99666aeb00",
27
- "@webiny/validation": "0.0.0-unstable.99666aeb00",
19
+ "@webiny/app": "0.0.0-unstable.a9593f74dd",
20
+ "@webiny/app-admin": "0.0.0-unstable.a9593f74dd",
21
+ "@webiny/app-security": "0.0.0-unstable.a9593f74dd",
22
+ "@webiny/feature-flags": "0.0.0-unstable.a9593f74dd",
23
+ "@webiny/form": "0.0.0-unstable.a9593f74dd",
24
+ "@webiny/plugins": "0.0.0-unstable.a9593f74dd",
25
+ "@webiny/react-router": "0.0.0-unstable.a9593f74dd",
26
+ "@webiny/ui": "0.0.0-unstable.a9593f74dd",
27
+ "@webiny/validation": "0.0.0-unstable.a9593f74dd",
28
28
  "emotion": "10.0.27",
29
29
  "graphql-tag": "2.12.6",
30
30
  "lodash": "4.17.21",
@@ -33,17 +33,16 @@
33
33
  "react-helmet": "6.1.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@babel/cli": "7.20.7",
37
- "@babel/core": "7.20.12",
36
+ "@babel/cli": "7.22.6",
37
+ "@babel/core": "7.22.8",
38
38
  "@babel/plugin-proposal-class-properties": "7.18.6",
39
- "@babel/preset-env": "7.20.2",
40
- "@babel/preset-react": "7.18.6",
41
- "@babel/preset-typescript": "7.18.6",
39
+ "@babel/preset-env": "7.22.7",
40
+ "@babel/preset-react": "7.22.5",
41
+ "@babel/preset-typescript": "7.22.5",
42
42
  "@types/react-helmet": "6.1.6",
43
- "@webiny/cli": "0.0.0-unstable.99666aeb00",
44
- "@webiny/project-utils": "0.0.0-unstable.99666aeb00",
43
+ "@webiny/cli": "0.0.0-unstable.a9593f74dd",
44
+ "@webiny/project-utils": "0.0.0-unstable.a9593f74dd",
45
45
  "babel-plugin-emotion": "9.2.11",
46
- "babel-plugin-lodash": "3.3.4",
47
46
  "rimraf": "3.0.2",
48
47
  "ttypescript": "1.5.15",
49
48
  "typescript": "4.7.4"
@@ -63,5 +62,5 @@
63
62
  ]
64
63
  }
65
64
  },
66
- "gitHead": "99666aeb00056c56292eeb5dbb6aba7fda2439e2"
65
+ "gitHead": "a9593f74ddf9ce93263eadb0ddc0807ed343f5ee"
67
66
  }
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Permission = void 0;
7
- var Permission;
8
- exports.Permission = Permission;
9
- (function (Permission) {
7
+ var Permission = /*#__PURE__*/function (Permission) {
10
8
  Permission["Groups"] = "security.group";
11
9
  Permission["Teams"] = "security.team";
12
10
  Permission["ApiKeys"] = "security.apiKey";
13
- })(Permission || (exports.Permission = Permission = {}));
11
+ return Permission;
12
+ }({});
13
+ exports.Permission = Permission;
14
+
15
+ //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Permission"],"sources":["constants.ts"],"sourcesContent":["export enum Permission {\n Groups = \"security.group\",\n Teams = \"security.team\",\n ApiKeys = \"security.apiKey\"\n}\n"],"mappings":";;;;;;IAAYA,UAAU;AAAA;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,0BAAVA,UAAU"}
1
+ {"version":3,"names":["Permission","exports"],"sources":["constants.ts"],"sourcesContent":["export enum Permission {\n Groups = \"security.group\",\n Teams = \"security.team\",\n ApiKeys = \"security.apiKey\"\n}\n"],"mappings":";;;;;;IAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAAC,OAAA,CAAAD,UAAA,GAAAA,UAAA"}
package/plugins/index.js CHANGED
@@ -11,4 +11,6 @@ var _secureRouteError = _interopRequireDefault(require("./secureRouteError"));
11
11
  var _default = function _default() {
12
12
  return [_installation.default, _permissionRenderer.default, _secureRouteError.default];
13
13
  };
14
- exports.default = _default;
14
+ exports.default = _default;
15
+
16
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["installation","permissionRenderer","secureRouteError"],"sources":["index.ts"],"sourcesContent":["import { PluginCollection } from \"@webiny/plugins/types\";\nimport installation from \"./installation\";\nimport permissionRenderer from \"./permissionRenderer\";\nimport secureRouteError from \"~/plugins/secureRouteError\";\n\nexport default (): PluginCollection => [installation, permissionRenderer, secureRouteError];\n"],"mappings":";;;;;;;AACA;AACA;AACA;AAA0D,eAE3C;EAAA,OAAwB,CAACA,qBAAY,EAAEC,2BAAkB,EAAEC,yBAAgB,CAAC;AAAA;AAAA"}
1
+ {"version":3,"names":["_installation","_interopRequireDefault","require","_permissionRenderer","_secureRouteError","_default","installation","permissionRenderer","secureRouteError","exports","default"],"sources":["index.ts"],"sourcesContent":["import { PluginCollection } from \"@webiny/plugins/types\";\nimport installation from \"./installation\";\nimport permissionRenderer from \"./permissionRenderer\";\nimport secureRouteError from \"~/plugins/secureRouteError\";\n\nexport default (): PluginCollection => [installation, permissionRenderer, secureRouteError];\n"],"mappings":";;;;;;;AACA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0D,IAAAG,QAAA,GAE3C,SAAAA,SAAA;EAAA,OAAwB,CAACC,qBAAY,EAAEC,2BAAkB,EAAEC,yBAAgB,CAAC;AAAA;AAAAC,OAAA,CAAAC,OAAA,GAAAL,QAAA"}
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
11
  var _react = _interopRequireWildcard(require("react"));
@@ -63,27 +61,13 @@ var plugin = {
63
61
  title: "Security",
64
62
  dependencies: ["admin-installation-tenancy"],
65
63
  secure: false,
66
- getInstalledVersion: function getInstalledVersion(_ref3) {
67
- return (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
68
- var client, _yield$client$query, data;
69
- return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
70
- while (1) switch (_context.prev = _context.next) {
71
- case 0:
72
- client = _ref3.client;
73
- _context.next = 3;
74
- return client.query({
75
- query: IS_INSTALLED
76
- });
77
- case 3:
78
- _yield$client$query = _context.sent;
79
- data = _yield$client$query.data;
80
- return _context.abrupt("return", data.security.version);
81
- case 6:
82
- case "end":
83
- return _context.stop();
84
- }
85
- }, _callee);
86
- }))();
64
+ getInstalledVersion: async function getInstalledVersion(_ref3) {
65
+ var client = _ref3.client;
66
+ var _await$client$query = await client.query({
67
+ query: IS_INSTALLED
68
+ }),
69
+ data = _await$client$query.data;
70
+ return data.security.version;
87
71
  },
88
72
  render: function render(_ref4) {
89
73
  var onInstalled = _ref4.onInstalled;
@@ -93,4 +77,6 @@ var plugin = {
93
77
  }
94
78
  };
95
79
  var _default = plugin;
96
- exports.default = _default;
80
+ exports.default = _default;
81
+
82
+ //# sourceMappingURL=installation.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SimpleFormPlaceholder","styled","minHeight","minWidth","IS_INSTALLED","gql","INSTALL","SecurityInstaller","onInstalled","client","useApolloClient","useState","error","setError","useEffect","mutate","mutation","then","data","security","install","message","setTimeout","label","plugin","name","type","title","dependencies","secure","getInstalledVersion","query","version","render"],"sources":["installation.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport gql from \"graphql-tag\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { SimpleForm, SimpleFormContent } from \"@webiny/app-admin/components/SimpleForm\";\nimport styled from \"@emotion/styled\";\nimport { AdminInstallationPlugin } from \"@webiny/app-admin/types\";\n\nconst SimpleFormPlaceholder = styled.div({\n minHeight: 300,\n minWidth: 400\n});\n\nconst IS_INSTALLED = gql`\n query IsSecurityInstalled {\n security {\n version\n }\n }\n`;\n\nconst INSTALL = gql`\n mutation InstallSecurity {\n security {\n install {\n data\n error {\n code\n message\n }\n }\n }\n }\n`;\n\ninterface SecurityInstallerProps {\n onInstalled: () => void;\n}\nconst SecurityInstaller: React.FC<SecurityInstallerProps> = ({ onInstalled }) => {\n const client = useApolloClient();\n const [error, setError] = useState(null);\n\n useEffect(() => {\n client.mutate({ mutation: INSTALL }).then(({ data }) => {\n const { error } = data.security.install;\n if (error) {\n setError(error.message);\n return;\n }\n\n // Just so the user sees the actual message.\n setTimeout(onInstalled, 3000);\n });\n }, []);\n\n const label = error ? (\n <Alert title={`Something went wrong`} type={\"danger\"}>\n {error}\n </Alert>\n ) : (\n `Installing Security...`\n );\n\n return (\n <SimpleForm>\n <CircularProgress label={label} />\n <SimpleFormContent>\n <SimpleFormPlaceholder />\n </SimpleFormContent>\n </SimpleForm>\n );\n};\n\nconst plugin: AdminInstallationPlugin = {\n name: \"admin-installation-security\",\n type: \"admin-installation\",\n title: `Security`,\n dependencies: [`admin-installation-tenancy`],\n secure: false,\n async getInstalledVersion({ client }) {\n const { data } = await client.query({ query: IS_INSTALLED });\n return data.security.version;\n },\n render({ onInstalled }) {\n return <SecurityInstaller onInstalled={onInstalled} />;\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAqC;AAGrC,IAAMA,qBAAqB,oBAAGC,eAAM;EAAA;EAAA;AAAA,GAAK;EACrCC,SAAS,EAAE,GAAG;EACdC,QAAQ,EAAE;AACd,CAAC,CAAC;AAEF,IAAMC,YAAY,OAAGC,mBAAG,kLAMvB;AAED,IAAMC,OAAO,OAAGD,mBAAG,6TAYlB;AAKD,IAAME,iBAAmD,GAAG,SAAtDA,iBAAmD,OAAwB;EAAA,IAAlBC,WAAW,QAAXA,WAAW;EACtE,IAAMC,MAAM,GAAG,IAAAC,2BAAe,GAAE;EAChC,gBAA0B,IAAAC,eAAQ,EAAC,IAAI,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oBAAO,6BAAC,iBAAiB;MAAC,WAAW,EAAEA;IAAY,EAAG;EAC1D;AACJ,CAAC;AAAC,eAEagB,MAAM;AAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_graphqlTag","_interopRequireDefault","_reactHooks","_Alert","_Progress","_SimpleForm","_styled","_templateObject","_templateObject2","SimpleFormPlaceholder","styled","target","label","minHeight","minWidth","IS_INSTALLED","gql","_taggedTemplateLiteral2","default","INSTALL","SecurityInstaller","_ref","onInstalled","client","useApolloClient","_useState","useState","_useState2","_slicedToArray2","error","setError","useEffect","mutate","mutation","then","_ref2","data","security","install","message","setTimeout","createElement","Alert","title","type","SimpleForm","CircularProgress","SimpleFormContent","plugin","name","dependencies","secure","getInstalledVersion","_ref3","_await$client$query","query","version","render","_ref4","_default","exports"],"sources":["installation.tsx"],"sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport gql from \"graphql-tag\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { SimpleForm, SimpleFormContent } from \"@webiny/app-admin/components/SimpleForm\";\nimport styled from \"@emotion/styled\";\nimport { AdminInstallationPlugin } from \"@webiny/app-admin/types\";\n\nconst SimpleFormPlaceholder = styled.div({\n minHeight: 300,\n minWidth: 400\n});\n\nconst IS_INSTALLED = gql`\n query IsSecurityInstalled {\n security {\n version\n }\n }\n`;\n\nconst INSTALL = gql`\n mutation InstallSecurity {\n security {\n install {\n data\n error {\n code\n message\n }\n }\n }\n }\n`;\n\ninterface SecurityInstallerProps {\n onInstalled: () => void;\n}\nconst SecurityInstaller = ({ onInstalled }: SecurityInstallerProps) => {\n const client = useApolloClient();\n const [error, setError] = useState(null);\n\n useEffect(() => {\n client.mutate({ mutation: INSTALL }).then(({ data }) => {\n const { error } = data.security.install;\n if (error) {\n setError(error.message);\n return;\n }\n\n // Just so the user sees the actual message.\n setTimeout(onInstalled, 3000);\n });\n }, []);\n\n const label = error ? (\n <Alert title={`Something went wrong`} type={\"danger\"}>\n {error}\n </Alert>\n ) : (\n `Installing Security...`\n );\n\n return (\n <SimpleForm>\n <CircularProgress label={label} />\n <SimpleFormContent>\n <SimpleFormPlaceholder />\n </SimpleFormContent>\n </SimpleForm>\n );\n};\n\nconst plugin: AdminInstallationPlugin = {\n name: \"admin-installation-security\",\n type: \"admin-installation\",\n title: `Security`,\n dependencies: [`admin-installation-tenancy`],\n secure: false,\n async getInstalledVersion({ client }) {\n const { data } = await client.query({ query: IS_INSTALLED });\n return data.security.version;\n },\n render({ onInstalled }) {\n return <SecurityInstaller onInstalled={onInstalled} />;\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAqC,IAAAQ,eAAA,EAAAC,gBAAA;AAGrC,IAAMC,qBAAqB,oBAAGC,eAAM;EAAAC,MAAA;EAAAC,KAAA;AAAA,GAAK;EACrCC,SAAS,EAAE,GAAG;EACdC,QAAQ,EAAE;AACd,CAAC,CAAC;AAEF,IAAMC,YAAY,OAAGC,mBAAG,EAAAT,eAAA,KAAAA,eAAA,OAAAU,uBAAA,CAAAC,OAAA,uGAMvB;AAED,IAAMC,OAAO,OAAGH,mBAAG,EAAAR,gBAAA,KAAAA,gBAAA,OAAAS,uBAAA,CAAAC,OAAA,gPAYlB;AAKD,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAgD;EAAA,IAA1CC,WAAW,GAAAD,IAAA,CAAXC,WAAW;EACpC,IAAMC,MAAM,GAAG,IAAAC,2BAAe,E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,KAAK,YAAY;EACjBO,YAAY,EAAE,8BAA8B;EAC5CC,MAAM,EAAE,KAAK;EACPC,mBAAmB,iBAAAA,oBAAAC,KAAA,EAAa;IAAA,IAAV9B,MAAM,GAAA8B,KAAA,CAAN9B,MAAM;IAC9B,IAAA+B,mBAAA,GAAiB,MAAM/B,MAAM,CAACgC,KAAK,CAAC;QAAEA,KAAK,EAAExC;MAAa,CAAC,CAAC;MAApDqB,IAAI,GAAAkB,mBAAA,CAAJlB,IAAI;IACZ,OAAOA,IAAI,CAACC,QAAQ,CAACmB,OAAO;EAChC,CAAC;EACDC,MAAM,WAAAA,OAAAC,KAAA,EAAkB;IAAA,IAAfpC,WAAW,GAAAoC,KAAA,CAAXpC,WAAW;IAChB,oBAAOzB,MAAA,CAAAqB,OAAA,CAAAuB,aAAA,CAACrB,iBAAiB;MAACE,WAAW,EAAEA;IAAY,CAAE,CAAC;EAC1D;AACJ,CAAC;AAAC,IAAAqC,QAAA,GAEaX,MAAM;AAAAY,OAAA,CAAA1C,OAAA,GAAAyC,QAAA"}
@@ -1,8 +1,8 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  import { SecurityPermission } from "@webiny/app-security/types";
3
3
  interface SecurityPermissionsProps {
4
4
  value: SecurityPermission[];
5
5
  onChange: (value: SecurityPermission[]) => void;
6
6
  }
7
- export declare const SecurityPermissions: React.FC<SecurityPermissionsProps>;
7
+ export declare const SecurityPermissions: ({ value, onChange }: SecurityPermissionsProps) => JSX.Element;
8
8
  export {};
@@ -219,4 +219,6 @@ var SecurityPermissions = function SecurityPermissions(_ref) {
219
219
  }, t(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["Full access"])))))))))));
220
220
  });
221
221
  };
222
- exports.SecurityPermissions = SecurityPermissions;
222
+ exports.SecurityPermissions = SecurityPermissions;
223
+
224
+ //# sourceMappingURL=SecurityPermissions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["t","i18n","ns","SECURITY","SECURITY_FULL_ACCESS","SECURITY_GROUP_ACCESS","SECURITY_TEAM_ACCESS","SECURITY_API_KEY_ACCESS","FULL_ACCESS","NO_ACCESS","CUSTOM_ACCESS","SecurityPermissions","value","onChange","useSecurity","getPermission","useWcp","getProject","cannotUseAacl","useMemo","project","teams","package","features","advancedAccessControlLayer","options","onFormChange","useCallback","data","newValue","Array","isArray","filter","item","name","startsWith","permissions","accessLevel","push","groupAccessScope","teamAccessScope","apiKeyAccessScope","length","formData","hasFullAccess","find","hasGroupAccess","hasTeamAccess","hasApiKeyAccess","Bind","gridNoPaddingClass","marginTop"],"sources":["SecurityPermissions.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n gridNoPaddingClass\n} from \"@webiny/app-admin/components/Permissions\";\nimport { Form } from \"@webiny/form\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { SecurityPermission } from \"@webiny/app-security/types\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { AaclPermission, useWcp } from \"@webiny/app-admin\";\n\nconst t = i18n.ns(\"app-security-admin-users/plugins/permissionRenderer\");\n\nconst SECURITY = \"security\";\nconst SECURITY_FULL_ACCESS = `${SECURITY}.*`;\nconst SECURITY_GROUP_ACCESS = `${SECURITY}.group`;\nconst SECURITY_TEAM_ACCESS = `${SECURITY}.team`;\nconst SECURITY_API_KEY_ACCESS = `${SECURITY}.apiKey`;\nconst FULL_ACCESS = \"full\";\nconst NO_ACCESS = \"no\";\nconst CUSTOM_ACCESS = \"custom\";\n\ninterface SecurityPermissionsProps {\n value: SecurityPermission[];\n onChange: (value: SecurityPermission[]) => void;\n}\n\nexport const SecurityPermissions: React.FC<SecurityPermissionsProps> = ({ value, onChange }) => {\n const { getPermission } = useSecurity();\n const { getProject } = useWcp();\n\n // We disable form elements for custom permissions if AACL cannot be used.\n const cannotUseAacl = useMemo(() => {\n return !getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const project = getProject();\n let teams = false;\n if (project) {\n teams = project.package.features.advancedAccessControlLayer.options.teams;\n }\n\n const onFormChange = useCallback(\n data => {\n let newValue: SecurityPermission[] = [];\n if (Array.isArray(value)) {\n // Let's just filter out the `security*` permission objects, it's easier to build new ones from scratch.\n newValue = value.filter(item => !item.name.startsWith(SECURITY));\n }\n\n const permissions = [];\n if (data.accessLevel === FULL_ACCESS) {\n permissions.push({ name: SECURITY_FULL_ACCESS });\n } else if (data.accessLevel === CUSTOM_ACCESS) {\n if (data.groupAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_GROUP_ACCESS });\n }\n\n if (data.teamAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_TEAM_ACCESS });\n }\n\n if (data.apiKeyAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_API_KEY_ACCESS });\n }\n }\n\n if (permissions && permissions.length) {\n newValue.push(...permissions);\n }\n\n onChange(newValue);\n },\n [value]\n );\n\n const formData = useMemo(() => {\n if (!Array.isArray(value)) {\n return { accessLevel: NO_ACCESS };\n }\n\n const hasFullAccess = value.find(\n item => item.name === SECURITY_FULL_ACCESS || item.name === \"*\"\n );\n\n if (hasFullAccess) {\n return { accessLevel: FULL_ACCESS };\n }\n\n const permissions = value.filter(item => item.name.startsWith(SECURITY));\n if (permissions.length === 0) {\n return { accessLevel: NO_ACCESS };\n }\n\n const data = {\n accessLevel: CUSTOM_ACCESS,\n groupAccessScope: NO_ACCESS,\n teamAccessScope: NO_ACCESS,\n apiKeyAccessScope: NO_ACCESS\n };\n\n const hasGroupAccess = permissions.find(item => item.name === SECURITY_GROUP_ACCESS);\n if (hasGroupAccess) {\n data.groupAccessScope = FULL_ACCESS;\n }\n const hasTeamAccess = permissions.find(item => item.name === SECURITY_TEAM_ACCESS);\n if (hasTeamAccess) {\n data.teamAccessScope = FULL_ACCESS;\n }\n\n const hasApiKeyAccess = permissions.find(item => item.name === SECURITY_API_KEY_ACCESS);\n if (hasApiKeyAccess) {\n data.apiKeyAccessScope = FULL_ACCESS;\n }\n\n return data;\n }, []);\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind }) => {\n return (\n <Fragment>\n <Grid className={gridNoPaddingClass}>\n <Cell span={12}>\n {data.accessLevel === \"custom\" && cannotUseAacl && (\n <CannotUseAaclAlert />\n )}\n </Cell>\n </Grid>\n <Grid className={gridNoPaddingClass}>\n <Cell span={6}>\n <PermissionInfo title={t`Access Level`} />\n </Cell>\n <Cell span={6}>\n <Bind name={\"accessLevel\"}>\n <Select label={t`Access Level`}>\n <option value={NO_ACCESS}>{t`No access`}</option>\n <option value={FULL_ACCESS}>{t`Full access`}</option>\n <option value={CUSTOM_ACCESS}>{t`Custom access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && (\n <React.Fragment>\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`API Keys`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"apiKeyAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`Roles`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"groupAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n {teams && (\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`Teams`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"teamAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n )}\n </React.Fragment>\n )}\n </Fragment>\n );\n }}\n </Form>\n );\n};\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AAEA;AACA;AAA2D;AAE3D,IAAMA,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,qDAAqD,CAAC;AAExE,IAAMC,QAAQ,GAAG,UAAU;AAC3B,IAAMC,oBAAoB,aAAMD,QAAQ,OAAI;AAC5C,IAAME,qBAAqB,aAAMF,QAAQ,WAAQ;AACjD,IAAMG,oBAAoB,aAAMH,QAAQ,UAAO;AAC/C,IAAMI,uBAAuB,aAAMJ,QAAQ,YAAS;AACpD,IAAMK,WAAW,GAAG,MAAM;AAC1B,IAAMC,SAAS,GAAG,IAAI;AACtB,IAAMC,aAAa,GAAG,QAAQ;AAOvB,IAAMC,mBAAuD,GAAG,SAA1DA,mBAAuD,OAA4B;EAAA,IAAtBC,KAAK,QAALA,KAAK;IAAEC,QAAQ,QAARA,QAAQ;EACrF,mBAA0B,IAAAC,wBAAW,GAAE;IAA/BC,aAAa,gBAAbA,aAAa;EACrB,cAAuB,IAAAC,gBAAM,GAAE;IAAvBC,UAAU,WAAVA,UAAU;;EAElB;EACA,IAAMC,aAAa,GAAG,IAAAC,cAAO,EAAC,YAAM;IAChC,OAAO,CAACJ,aAAa,CAAiB,MAAM,EAAE,IAAI,CAAC;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMK,OAAO,GAAGH,UAAU,EAAE;EAC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AAG,EAAE;IAAW,GAAEnD,CAAC,6FAAqB,CACjD,eACP,6BAAC,UAAI;MAAC,IAAI,EAAE;IAAG,gBACX,6BAAC,IAAI;MAAC,IAAI,EAAE;IAAkB,gBAC1B,6BAAC,cAAM;MACH,KAAK,EAAEA,CAAC,mGAAe;MACvB,QAAQ,EAAEkB;IAAc,gBAExB;MACI,KAAK,EAAET;IAAU,GACnBT,CAAC,iGAAqB,eACxB;MACI,KAAK,EAAEQ;IAAY,GACrBR,CAAC,mGAAuB,CACrB,CACN,CACJ,CACJ,CAEd,CAER,CACM;EAEnB,CAAC,CACE;AAEf,CAAC;AAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_Grid","_Select","_i18n","_Permissions","_form","_Elevation","_Typography","_appSecurity","_appAdmin","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","_templateObject16","_templateObject17","t","i18n","ns","SECURITY","SECURITY_FULL_ACCESS","concat","SECURITY_GROUP_ACCESS","SECURITY_TEAM_ACCESS","SECURITY_API_KEY_ACCESS","FULL_ACCESS","NO_ACCESS","CUSTOM_ACCESS","SecurityPermissions","_ref","value","onChange","_useSecurity","useSecurity","getPermission","_useWcp","useWcp","getProject","cannotUseAacl","useMemo","project","teams","package","features","advancedAccessControlLayer","options","onFormChange","useCallback","data","newValue","Array","isArray","filter","item","name","startsWith","permissions","accessLevel","push","groupAccessScope","teamAccessScope","apiKeyAccessScope","length","_newValue","apply","formData","hasFullAccess","find","hasGroupAccess","hasTeamAccess","hasApiKeyAccess","default","createElement","Form","_ref2","Bind","Fragment","Grid","className","gridNoPaddingClass","Cell","span","CannotUseAaclAlert","PermissionInfo","title","_taggedTemplateLiteral2","Select","label","Elevation","z","style","marginTop","Typography","use","disabled","exports"],"sources":["SecurityPermissions.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n gridNoPaddingClass\n} from \"@webiny/app-admin/components/Permissions\";\nimport { Form } from \"@webiny/form\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { SecurityPermission } from \"@webiny/app-security/types\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { AaclPermission, useWcp } from \"@webiny/app-admin\";\n\nconst t = i18n.ns(\"app-security-admin-users/plugins/permissionRenderer\");\n\nconst SECURITY = \"security\";\nconst SECURITY_FULL_ACCESS = `${SECURITY}.*`;\nconst SECURITY_GROUP_ACCESS = `${SECURITY}.group`;\nconst SECURITY_TEAM_ACCESS = `${SECURITY}.team`;\nconst SECURITY_API_KEY_ACCESS = `${SECURITY}.apiKey`;\nconst FULL_ACCESS = \"full\";\nconst NO_ACCESS = \"no\";\nconst CUSTOM_ACCESS = \"custom\";\n\ninterface SecurityPermissionsProps {\n value: SecurityPermission[];\n onChange: (value: SecurityPermission[]) => void;\n}\n\nexport const SecurityPermissions = ({ value, onChange }: SecurityPermissionsProps) => {\n const { getPermission } = useSecurity();\n const { getProject } = useWcp();\n\n // We disable form elements for custom permissions if AACL cannot be used.\n const cannotUseAacl = useMemo(() => {\n return !getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const project = getProject();\n let teams = false;\n if (project) {\n teams = project.package.features.advancedAccessControlLayer.options.teams;\n }\n\n const onFormChange = useCallback(\n data => {\n let newValue: SecurityPermission[] = [];\n if (Array.isArray(value)) {\n // Let's just filter out the `security*` permission objects, it's easier to build new ones from scratch.\n newValue = value.filter(item => !item.name.startsWith(SECURITY));\n }\n\n const permissions = [];\n if (data.accessLevel === FULL_ACCESS) {\n permissions.push({ name: SECURITY_FULL_ACCESS });\n } else if (data.accessLevel === CUSTOM_ACCESS) {\n if (data.groupAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_GROUP_ACCESS });\n }\n\n if (data.teamAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_TEAM_ACCESS });\n }\n\n if (data.apiKeyAccessScope === FULL_ACCESS) {\n permissions.push({ name: SECURITY_API_KEY_ACCESS });\n }\n }\n\n if (permissions && permissions.length) {\n newValue.push(...permissions);\n }\n\n onChange(newValue);\n },\n [value]\n );\n\n const formData = useMemo(() => {\n if (!Array.isArray(value)) {\n return { accessLevel: NO_ACCESS };\n }\n\n const hasFullAccess = value.find(\n item => item.name === SECURITY_FULL_ACCESS || item.name === \"*\"\n );\n\n if (hasFullAccess) {\n return { accessLevel: FULL_ACCESS };\n }\n\n const permissions = value.filter(item => item.name.startsWith(SECURITY));\n if (permissions.length === 0) {\n return { accessLevel: NO_ACCESS };\n }\n\n const data = {\n accessLevel: CUSTOM_ACCESS,\n groupAccessScope: NO_ACCESS,\n teamAccessScope: NO_ACCESS,\n apiKeyAccessScope: NO_ACCESS\n };\n\n const hasGroupAccess = permissions.find(item => item.name === SECURITY_GROUP_ACCESS);\n if (hasGroupAccess) {\n data.groupAccessScope = FULL_ACCESS;\n }\n const hasTeamAccess = permissions.find(item => item.name === SECURITY_TEAM_ACCESS);\n if (hasTeamAccess) {\n data.teamAccessScope = FULL_ACCESS;\n }\n\n const hasApiKeyAccess = permissions.find(item => item.name === SECURITY_API_KEY_ACCESS);\n if (hasApiKeyAccess) {\n data.apiKeyAccessScope = FULL_ACCESS;\n }\n\n return data;\n }, []);\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind }) => {\n return (\n <Fragment>\n <Grid className={gridNoPaddingClass}>\n <Cell span={12}>\n {data.accessLevel === \"custom\" && cannotUseAacl && (\n <CannotUseAaclAlert />\n )}\n </Cell>\n </Grid>\n <Grid className={gridNoPaddingClass}>\n <Cell span={6}>\n <PermissionInfo title={t`Access Level`} />\n </Cell>\n <Cell span={6}>\n <Bind name={\"accessLevel\"}>\n <Select label={t`Access Level`}>\n <option value={NO_ACCESS}>{t`No access`}</option>\n <option value={FULL_ACCESS}>{t`Full access`}</option>\n <option value={CUSTOM_ACCESS}>{t`Custom access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && (\n <React.Fragment>\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`API Keys`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"apiKeyAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`Roles`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"groupAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n {teams && (\n <Elevation z={1} style={{ marginTop: 10 }}>\n <Grid>\n <Cell span={12}>\n <Typography use={\"overline\"}>{t`Teams`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"teamAccessScope\"}>\n <Select\n label={t`Access Scope`}\n disabled={cannotUseAacl}\n >\n <option\n value={NO_ACCESS}\n >{t`No access`}</option>\n <option\n value={FULL_ACCESS}\n >{t`Full access`}</option>\n </Select>\n </Bind>\n </Cell>\n </Grid>\n </Elevation>\n )}\n </React.Fragment>\n )}\n </Fragment>\n );\n }}\n </Form>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAC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