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)
How to implement such a workflow in
ASP.NET MVC
? How to impelementUI
,views
so that group with lower priority can both visually/technically perform onlyallowed transitions
? Can I somehow extend that system: link?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– Adam Zuckerman2014年04月18日 08:33:43 +00:00Commented Apr 18, 2014 at 8:33
-
@AdamZuckerman yes.lexeme– lexeme2014年04月20日 16:02:45 +00:00Commented Apr 20, 2014 at 16:02
1 Answer 1
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
Explore related questions
See similar questions with these tags.