Guest, User, Moderator, Administrator - vs - User (roles: guest, user, moderator, administrator)

StackOverflow https://stackoverflow.com/questions/18660205

  •  27-06-2022
  •  | 
  •  

문제

Is it better, in modeling web application use case diagram, to create an actor for each role of user can have or to have one actor, user and a matrix with privileges?

Guest < User < Moderator < Administrator

1: Guest, User, Moderator, Administrator

  • Guest: register, reset password, login
  • User: edit (self), logout
  • Moderator: edit (every user),
  • Administrator: manage privileges

2: User (roles: guest, user, moderator, administrator)

  • User: register, reset password, login, edit, logout, manage privileges

Matrix:

                   guest  user  moderator  administrator
register           x
reset password     x      x
login              x
logout                    x     x          x
edit (self)               x     x          x
edit (every user)               x          x
manage privileges                          x

Which one is better? 1 or 2?

도움이 되었습니까?

해결책

Are you modeling (like your question says) or implementing?

If you're modeling the use of the web site then you definitely want to think of the different actors and work out what they want (or are allowed) to do. Do that and think about it (make sure people can login and logout as the comments above note). Then use the information you have to do the implementation.

For the implementation you almost certainly want to do it as a matrix of privileges, as it's easier to implement and expand. But you definitely want to put yourself in the shoes of each possible user up front and decide what rights they need/want before going to the matrix.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top