Commit c0915da6 authored by Michal Čihař's avatar Michal Čihař

Add methods for per project user management

Issue #509
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 943c1798
......@@ -168,6 +168,20 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
)
raise PermissionDenied
def all_users(self):
"""
Returns all users having ACL on this project.
"""
group = Group.objects.get(name=self.name)
return group.user_set.all()
def add_user(self, user):
"""
Adds user based on username of email.
"""
group = Group.objects.get(name=self.name)
user.groups.add(group)
def clean(self):
try:
self.create_path()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment