Fix data pages permissions handling

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-31 16:31:33 +01:00
committed by Bryan Frimin
parent 5b0627b05a
commit f3e23850ff
12 changed files with 333 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<2000fd2ccfcf4b832c51ff71b0326fef>>
* @generated SignedSource<<bfe5e85608cbcd0fd0db44ad909ac493>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -322,6 +322,32 @@ return {
"name": "createdAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:delete\")"
},
(v13/*: any*/)
],
"storageKey": null
@@ -411,16 +437,16 @@ return {
]
},
"params": {
"cacheID": "dbca2ff147e8b1e367a266fcf016b184",
"cacheID": "c022cb17d3ede74899755b606ce95ba9",
"id": null,
"metadata": {},
"name": "DataListQuery",
"operationKind": "query",
"text": "query DataListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 10\n $last: Int = null\n $order: DatumOrder = null\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DataPageFragment_25MC8O\n id\n }\n}\n\nfragment DataPageFragment_25MC8O on Organization {\n data(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
"text": "query DataListQuery(\n $after: CursorKey = null\n $before: CursorKey = null\n $first: Int = 10\n $last: Int = null\n $order: DatumOrder = null\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...DataPageFragment_25MC8O\n id\n }\n}\n\nfragment DataPageFragment_25MC8O on Organization {\n data(first: $first, after: $after, last: $last, before: $before, orderBy: $order, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n canUpdate: permission(action: \"core:datum:update\")\n canDelete: permission(action: \"core:datum:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "5d3069a0d856613ccb854033b5b1f14e";
(node as any).hash = "9a4453365a733d298ab9f5237fc4153b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<9619ee8f74aea67be931f8c40a8815c8>>
* @generated SignedSource<<213dd4c7bd0e87ba0e64fa6ce8d2c37b>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,8 @@ export type DataPageFragment$data = {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly canDelete: boolean;
readonly canUpdate: boolean;
readonly createdAt: any;
readonly dataClassification: DataClassification;
readonly id: string;
@@ -248,6 +250,32 @@ return {
"name": "createdAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:delete\")"
},
{
"alias": null,
"args": null,
@@ -329,6 +357,6 @@ return {
};
})();
(node as any).hash = "5d3069a0d856613ccb854033b5b1f14e";
(node as any).hash = "9a4453365a733d298ab9f5237fc4153b";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<43b67fe6155860e492f2a36543727d49>>
* @generated SignedSource<<8106bb4a10940caebf1f523fb6136350>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -25,6 +25,8 @@ export type DatumGraphCreateMutation$data = {
readonly createDatum: {
readonly datumEdge: {
readonly node: {
readonly canDelete: boolean;
readonly canUpdate: boolean;
readonly createdAt: any;
readonly dataClassification: DataClassification;
readonly id: string;
@@ -181,6 +183,32 @@ v5 = {
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:delete\")"
}
],
"storageKey": null
@@ -254,16 +282,16 @@ return {
]
},
"params": {
"cacheID": "23ff315b0cc090bcaca7739d945d8d1b",
"cacheID": "37d345acfe37d5edf653d021f8aad43c",
"id": null,
"metadata": {},
"name": "DatumGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation DatumGraphCreateMutation(\n $input: CreateDatumInput!\n) {\n createDatum(input: $input) {\n datumEdge {\n node {\n id\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n }\n }\n }\n}\n"
"text": "mutation DatumGraphCreateMutation(\n $input: CreateDatumInput!\n) {\n createDatum(input: $input) {\n datumEdge {\n node {\n id\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n canUpdate: permission(action: \"core:datum:update\")\n canDelete: permission(action: \"core:datum:delete\")\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "b148ef55d18d3a45c04b5072581f2285";
(node as any).hash = "db4781176e1b58224619f8237af92716";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7e67f2a3d41fbea46b7b8447595302a5>>
* @generated SignedSource<<034a68d54259fb22cf2d563699ad4257>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,7 @@ export type DatumGraphListQuery$variables = {
};
export type DatumGraphListQuery$data = {
readonly node: {
readonly canCreateDatum?: boolean;
readonly " $fragmentSpreads": FragmentRefs<"DataPageFragment">;
};
};
@@ -44,30 +45,43 @@ v1 = [
"variableName": "organizationId"
}
],
v2 = [
v2 = {
"alias": "canCreateDatum",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:create"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:create\")"
},
v3 = [
{
"kind": "Variable",
"name": "snapshotId",
"variableName": "snapshotId"
}
],
v3 = {
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = {
v5 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
v5 = [
v6 = [
{
"fields": (v2/*: any*/),
"fields": (v3/*: any*/),
"kind": "ObjectValue",
"name": "filter"
},
@@ -77,7 +91,7 @@ v5 = [
"value": 10
}
],
v6 = {
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
@@ -102,8 +116,9 @@ return {
{
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
{
"args": (v2/*: any*/),
"args": (v3/*: any*/),
"kind": "FragmentSpread",
"name": "DataPageFragment"
}
@@ -132,14 +147,15 @@ return {
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
{
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"concreteType": "DatumConnection",
"kind": "LinkedField",
"name": "data",
@@ -161,8 +177,8 @@ return {
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
(v6/*: any*/),
(v5/*: any*/),
(v7/*: any*/),
{
"alias": null,
"args": null,
@@ -185,7 +201,7 @@ return {
"name": "fullName",
"storageKey": null
},
(v4/*: any*/)
(v5/*: any*/)
],
"storageKey": null
},
@@ -219,8 +235,8 @@ return {
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
(v6/*: any*/),
(v5/*: any*/),
(v7/*: any*/),
{
"alias": null,
"args": null,
@@ -244,7 +260,33 @@ return {
"name": "createdAt",
"storageKey": null
},
(v3/*: any*/)
{
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:update\")"
},
{
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:delete\")"
},
(v4/*: any*/)
],
"storageKey": null
},
@@ -314,7 +356,7 @@ return {
},
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"filters": [
"filter"
],
@@ -333,16 +375,16 @@ return {
]
},
"params": {
"cacheID": "7200b7cf37859346d740de3f96f1d443",
"cacheID": "203f6661d76c730336cffaa96b631ab8",
"id": null,
"metadata": {},
"name": "DatumGraphListQuery",
"operationKind": "query",
"text": "query DatumGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID = null\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...DataPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment DataPageFragment_3iomuz on Organization {\n data(first: 10, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
"text": "query DatumGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID = null\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n canCreateDatum: permission(action: \"core:datum:create\")\n ...DataPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment DataPageFragment_3iomuz on Organization {\n data(first: 10, filter: {snapshotId: $snapshotId}) {\n edges {\n node {\n id\n name\n dataClassification\n owner {\n fullName\n id\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n canUpdate: permission(action: \"core:datum:update\")\n canDelete: permission(action: \"core:datum:delete\")\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n"
}
};
})();
(node as any).hash = "e0782332e7e82bd1a5e7f5e40ada2dae";
(node as any).hash = "e071e19eda0d4c105668ffd9671399bd";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<5cfbdbc980894977800a18064306f2c1>>
* @generated SignedSource<<e2ff7cc39a32a043a4d4c2ad4dac8411>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,6 +16,8 @@ export type DatumGraphNodeQuery$variables = {
};
export type DatumGraphNodeQuery$data = {
readonly node: {
readonly canDelete?: boolean;
readonly canUpdate?: boolean;
readonly createdAt?: any;
readonly dataClassification?: DataClassification;
readonly id?: string;
@@ -188,6 +190,32 @@ v10 = {
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
v11 = {
"alias": "canUpdate",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:update"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:update\")"
},
v12 = {
"alias": "canDelete",
"args": [
{
"kind": "Literal",
"name": "action",
"value": "core:datum:delete"
}
],
"kind": "ScalarField",
"name": "permission",
"storageKey": "permission(action:\"core:datum:delete\")"
};
return {
"fragment": {
@@ -215,7 +243,9 @@ return {
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/)
(v10/*: any*/),
(v11/*: any*/),
(v12/*: any*/)
],
"type": "Datum",
"abstractKey": null
@@ -259,7 +289,9 @@ return {
(v7/*: any*/),
(v8/*: any*/),
(v9/*: any*/),
(v10/*: any*/)
(v10/*: any*/),
(v11/*: any*/),
(v12/*: any*/)
],
"type": "Datum",
"abstractKey": null
@@ -270,16 +302,16 @@ return {
]
},
"params": {
"cacheID": "6ed49a3413c0214dc95da9a422e484b4",
"cacheID": "036588bb9b3daffb20c9d01a708976ac",
"id": null,
"metadata": {},
"name": "DatumGraphNodeQuery",
"operationKind": "query",
"text": "query DatumGraphNodeQuery(\n $dataId: ID!\n) {\n node(id: $dataId) {\n __typename\n ... on Datum {\n id\n snapshotId\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n organization {\n id\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
"text": "query DatumGraphNodeQuery(\n $dataId: ID!\n) {\n node(id: $dataId) {\n __typename\n ... on Datum {\n id\n snapshotId\n name\n dataClassification\n owner {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n organization {\n id\n }\n createdAt\n updatedAt\n canUpdate: permission(action: \"core:datum:update\")\n canDelete: permission(action: \"core:datum:delete\")\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "2f4df20b67f8b21eda5f510f250abda1";
(node as any).hash = "2b2e220e0bdd98bbee7ea72a00db7a61";
export default node;