-
Notifications
You must be signed in to change notification settings - Fork 1
Users
Camille Masset edited this page May 4, 2016
·
2 revisions
The model User is quite classical: it gathers basic data about the user (name, email, profile photo, ...).
The users are related to other objects in the application:
- cluster: a user must be member of at least one cluster;
- groups: a user can be a member of a group:
- if a user is invited to a group, the group is visible in its
invited_to_groupsfield; - if a user belongs to a group, the membership is in the field
groups(which is a list).
- if a user is invited to a group, the group is visible in its
-
email(string) : is used for authentication -
lastname(string) -
firstname(string) -
username(string, should be unique #TODO) -
phone(string, 21 chars) -
photo(modelsigma_files.Image) -
is_active(boolean, default: True) -
last_modified(datetime) -
join_date(datetime) -
is_superuser(boolean, default: False) -
is_staff(boolean, default: False)
-
clusters(M2M withCluster, related name:cluster_users) : users should be members of at least one cluster -
invited_to_groups(M2M withGroup, related name:invited_users) -
groups(M2M withGroupthroughGroupMember, related name:users)
We describe here the permissions concerning the users instances (and not what users are allowed to do).
We have implemented the permissions in order to respect the following rules:
- one can see another user's information if one is in the same cluster or if one belongs to a common group;
- one cannot modify a user, except oneself;
- one cannot delete a user, except oneself or if we are a Sigma admin.
All these rules should be implemented in the UserViewSet.