|
I am
not sure if your analysis is quite correct. The Group(1)-User(*)
relationship is not quite correct, since User might want to be in two groups at
the same time. For example, John can be in the group of Chemistry
Professor, as well as Substitute Teacher. Your relationship implies that a
user can ONLY be in 1 group. Similarly, your relationships to the Role
imply that the same Role cannot be shared among various
entities.
In fact, most of the relationships are N-to-N type of
relationships. A User CAN be in more than one Group, and the same Role CAN
be applied to more than 1
User/Group.
So here is my
suggestion:
1. Dump either Class or
Group
2. Assuming you dump Class, add a parent/children
relationships to Group as in Group(1)-Group(*), to indicate that one parent
group can contain multiple children groups.
3. Add a Group(*)-Role(*) relationship to indicate that
a group can have many roles and a single role can be in many
groups
4. Add a User(*)-Role(*) relationship to indicate that
a user can have multiple roles, and a role can accommodate many
users
5. Finally, add a Group(*)-User(*) relationship to
indicate that a user can be a part of many groups and a group can contain many
users
Your Group will contain a method called getRoles() as
well as getAllRoles() which would scan up the Group tree and return a set of all
the Roles assigned. Finally, your user would have a method called
getRoles() and getAllRoles() to return just the roles assigned directly to the
user, or all the roles that the user has access to through the assignment to a
Group(s) or otherwise.
You can also keep a side entity called UserRole which
would be maintained as you change the Group/User/Role relationships
dynamically. This will allow you to quickly answer the question
isInRole(User, Role).
This can be done with
OrionServer.
-AP_
|
- Design strategy George Mardale
- RE: Design strategy Alex Paransky
- RE: Design strategy George Mardale
- RE: Design strategy Owen Fellows
- Re: Design strategy George Mardale
- RE: Design strategy Shields James
- Re: Design strategy Daniel Lopez
- RE: Design strategy Simon Evans
- RE: Design strategy Alex Paransky
- Re: Design strategy George Mardale
- RE: Design strategy BRICKER_JONATHAN_E
- RE: Design strategy Alex Paransky
