Skip to content

Commit

Permalink
feat(core): Add support for permissions on custom fields
Browse files Browse the repository at this point in the history
Relates to #2671
  • Loading branch information
michaelbromley committed Feb 15, 2024
1 parent 28f529c commit 1c9f8f9
Show file tree
Hide file tree
Showing 15 changed files with 462 additions and 38 deletions.
10 changes: 10 additions & 0 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export type BooleanCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -723,6 +724,7 @@ export type CustomField = {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -842,6 +844,7 @@ export type DateTimeCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Int']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -1078,6 +1081,7 @@ export type FloatCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Float']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -1260,6 +1264,7 @@ export type IntCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Int']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -1610,6 +1615,7 @@ export type LocaleStringCustomFieldConfig = CustomField & {
nullable?: Maybe<Scalars['Boolean']['output']>;
pattern?: Maybe<Scalars['String']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand All @@ -1623,6 +1629,7 @@ export type LocaleTextCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -2973,6 +2980,7 @@ export type RelationCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
scalarFields: Array<Scalars['String']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -3160,6 +3168,7 @@ export type StringCustomFieldConfig = CustomField & {
options?: Maybe<Array<StringFieldOption>>;
pattern?: Maybe<Scalars['String']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -3265,6 +3274,7 @@ export type TextCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down
10 changes: 10 additions & 0 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export type BooleanCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -1305,6 +1306,7 @@ export type CustomField = {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -1503,6 +1505,7 @@ export type DateTimeCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Int']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -1808,6 +1811,7 @@ export type FloatCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Float']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -2013,6 +2017,7 @@ export type IntCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
step?: Maybe<Scalars['Int']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -2477,6 +2482,7 @@ export type LocaleStringCustomFieldConfig = CustomField & {
nullable?: Maybe<Scalars['Boolean']['output']>;
pattern?: Maybe<Scalars['String']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand All @@ -2490,6 +2496,7 @@ export type LocaleTextCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -5411,6 +5418,7 @@ export type RelationCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
scalarFields: Array<Scalars['String']['output']>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
Expand Down Expand Up @@ -5922,6 +5930,7 @@ export type StringCustomFieldConfig = CustomField & {
options?: Maybe<Array<StringFieldOption>>;
pattern?: Maybe<Scalars['String']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down Expand Up @@ -6163,6 +6172,7 @@ export type TextCustomFieldConfig = CustomField & {
name: Scalars['String']['output'];
nullable?: Maybe<Scalars['Boolean']['output']>;
readonly?: Maybe<Scalars['Boolean']['output']>;
requiresPermission?: Maybe<Array<Permission>>;
type: Scalars['String']['output'];
ui?: Maybe<Scalars['JSON']['output']>;
};
Expand Down
Loading

0 comments on commit 1c9f8f9

Please sign in to comment.