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

  • Do the members of higher priority groups have permissions to perform the same actions as lower priority groups? – Adam Zuckerman Apr 18 '14 at 8:33
  • @AdamZuckerman yes. – lexeme Apr 20 '14 at 16:02
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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.