You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a custom implementation of workflow versioning while waiting for the official workflow audit trail module to be rolled out. I would like some feedback and advice on how to:
Manage and store the workflows: Currently I'm storing them in the file system to make it easy to transfer between environments and import/export. I find it troublesome to always have to query it from a database. The problem is how do I implement this in containerized environment or if the client wants to use kubernetes?
What's the least invasive way to lock editting for a workflow: I am trying my best to avoid changing OC's default implementation, especially the database schema and stuff, to make it easy to upgrade between versions. How do I implement access control?
The cleanest way I can think of atm is to use IControllerModelConvention
public class AddAuthorizeFiltersControllerConvention : IControllerModelConvention
{
public void Apply(ControllerModel controller)
{
if (controller.ControllerName.ToUpper().Contains("WORKFLOW"))
{
controller.Filters.Add(new AuthorizeFilter(nameof(WorkflowRestriction)));
}
}
}
protected override async Task HandleRequirementAsync(
AuthorizationHandlerContext context,
WorkflowRestrictionRequirement requirement)
{
if (!MustCheck(context, WorkflowRestrictionRequirement.Name))
{
context.Succeed(requirement);
};
if (context.Resource is Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext resource)
{
ActionDescriptor actionDescriptor = resource.ActionDescriptor;
//[HttpGet]
//public async Task<IActionResult> EditProperties(WorkflowTypePropertiesViewModel viewModel, int? id)
//if id == null ==> user is trying to create a new workflow
_logger.LogInformation(actionDescriptor.DisplayName);
if (actionDescriptor.RouteValues["action"] == "EditProperties"
&& resource.RouteData.Values.ContainsKey("ID")
&& resource.HttpContext.Request.Method == "GET")
{
// do query and check if workflow is locked
}
else
{
context.Succeed(requirement);
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I've been working on a custom implementation of workflow versioning while waiting for the official workflow audit trail module to be rolled out. I would like some feedback and advice on how to:
Manage and store the workflows: Currently I'm storing them in the file system to make it easy to transfer between environments and import/export. I find it troublesome to always have to query it from a database. The problem is how do I implement this in containerized environment or if the client wants to use kubernetes?
What's the least invasive way to lock editting for a workflow: I am trying my best to avoid changing OC's default implementation, especially the database schema and stuff, to make it easy to upgrade between versions. How do I implement access control?
The cleanest way I can think of atm is to use IControllerModelConvention
Beta Was this translation helpful? Give feedback.
All reactions