3

Imagine there is an application (ASP.NET MVC) that processes some documents. The document must be revised several times by different group of users.

state/role rules:

  • simple user can only publish document; (priority: low)
  • userGroup1 can switch it to next state or reject it; (priority: higher)
  • userGroup2 can confirm previous state and switch it to next gradual state or reject it; (priority: highest)

    1. How to implement such a workflow in ASP.NET MVC? How to impelement UI, views so that group with lower priority can both visually/technically perform only allowed transitions? Can I somehow extend that system: link?

    2. Do I need extras like service bus, event sourcing for that?

enter image description here

John Strowsky
3471 gold badge2 silver badges7 bronze badges
asked Apr 18, 2014 at 8:05
2
  • Do the members of higher priority groups have permissions to perform the same actions as lower priority groups? Commented Apr 18, 2014 at 8:33
  • @AdamZuckerman yes. Commented Apr 20, 2014 at 16:02

1 Answer 1

2

I did something similar
Created a class user
And an enumeration role
HashSet of the roles the user is in

Create a public property for each authority

public bool CanPublish
{
 get { return roles.Contains(role.simple) || roles.Contains(role.Group1) ...; }
}

This gives you the freedom to add or remove roles and what roles have have what authority
The UI is not in the business of deciding what role can do what

answered Jun 1, 2014 at 15:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.