From 33d090f98d2b1ba2f477e5ac2dee83ab2c74471c Mon Sep 17 00:00:00 2001 From: Jamie Howard Date: Wed, 13 Sep 2023 14:51:39 +0100 Subject: [PATCH] chore(docs): extend contributor docs by RBAC for stages backend --- .../admin/01-ee/01-review-workflows.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/docs/docs/01-core/admin/01-ee/01-review-workflows.md b/docs/docs/docs/01-core/admin/01-ee/01-review-workflows.md index 1174beaa52..44a36830fd 100644 --- a/docs/docs/docs/01-core/admin/01-ee/01-review-workflows.md +++ b/docs/docs/docs/01-core/admin/01-ee/01-review-workflows.md @@ -29,6 +29,7 @@ This code is separated into several elements: - Controllers - _workflows_: `packages/core/admin/ee/server/controllers/workflows/index.js` - _stages_: `packages/core/admin/ee/server/controllers/workflows/stages/index.js` + - _assignees_: `packages/core/admin/ee/server/controllers/workflows/assignees/index.js` - Middlewares - [_DEPRECATED_] _contentTypeMiddleware_: `packages/core/admin/ee/server/middlewares/review-workflows.js` - Routes @@ -38,7 +39,10 @@ This code is separated into several elements: - _workflows_: `packages/core/admin/ee/server/services/review-workflows/workflows.js` - _stages_: `packages/core/admin/ee/server/services/review-workflows/stages.js` - _metrics_: `packages/core/admin/ee/server/services/review-workflows/metrics.js` + - _weekly-metrics_: `packages/core/admin/ee/server/services/review-workflows/weekly-metrics.js` - _validation_: `packages/core/admin/ee/server/services/review-workflows/validation.js` + - _assignees_: `packages/core/admin/ee/server/services/review-workflows/assignees.js` + - _stage-permissions_: `packages/core/admin/ee/server/services/review-workflows/stage-permissions.js` - Decorators - _EntityService_ decorator: `packages/core/admin/ee/server/services/review-workflows/entity-service-decorator.js` - Utils file @@ -67,6 +71,10 @@ Used to interact with the `strapi_workflows` content-type. Used to interact with the `strapi_workflows_stages` content-type. +#### assignees + +Used to interact with the `admin_users` content-type entities related to review workflow enabled content types. + ### Middlewares #### contentTypeMiddleware - _DEPRECATED_ @@ -117,6 +125,10 @@ This route updates the stage of a specific entity identified by the id parameter Returns a list of stages that a user has permission to transition into (based on the permission settings of a stage). +#### PUT `/content-manager/(collection|single)-types/:model_uid/:id/assignee` + +This route updates the assignee of the entity identified by the model_uid and id parameters. The updated entity is passed to the request body. + ### Services The Review Workflow feature of the Enterprise Edition includes several services to manipulate workflows and stages. Here is a list of those services: @@ -137,6 +149,18 @@ This service is used to manipulate the stages entities and to update stages on o This is the telemetry service used to gather information on the usage of this feature. It provides information on the number of workflows and stages created, as well as the frequency of stage updates on entities. +#### weekly-metrics + +Once a week we report on review workflows usage statistic. This service is used to set up the cron job responsible for gathering and sending statistics on: number of active workflows, average number of stages in a workflow, maximum number of stages across all workflows and the content types on which review workflows is activated. + +#### assignees + +This service is used to interact with admin user assignee relations on review workflow enabled content types. It provides the ability to: find the Id of an entity assignee, update and delete (unassign) the assignee on an entity. + +#### stage-permissions + +This service is used to enable RBAC functionality for review workflow stages. Each entry of the `strapi_workflows_stages` has a manyToMany relation with `admin_permissions`. The permissions held in this relation indicate which roles can change the review stage of an entry in this stage. The service provides the ability to: register and unregister new stage permissions based on stage and role Ids and to find out whether a role can transition from a given stage. + #### validation This service is used to ensure the feature is working as expected and validate the data to be valid.