Mercurial > kallithea
comparison rhodecode/model/notification.py @ 1982:87f0800abc7b beta
#227 Initial version of repository groups permissions system
- implemented none/read/write/admin permissions for groups
- wrote more tests for permissions, and new permissions groups
- a lot of code garden, splitted logic into proper models
- permissions on groups doesn't propagate yet to repositories
- deprecated some methods on api for managing permissions on
repositories for users, and users groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 28 Jan 2012 01:06:29 +0200 |
parents | 9da24750f563 |
children | 179604334d98 |
comparison
equal
deleted
inserted
replaced
1981:518f87919375 | 1982:87f0800abc7b |
---|---|
40 | 40 |
41 | 41 |
42 class NotificationModel(BaseModel): | 42 class NotificationModel(BaseModel): |
43 | 43 |
44 def __get_user(self, user): | 44 def __get_user(self, user): |
45 if isinstance(user, basestring): | 45 return self._get_instance(User, user, callback=User.get_by_username) |
46 return User.get_by_username(username=user) | |
47 else: | |
48 return self._get_instance(User, user) | |
49 | 46 |
50 def __get_notification(self, notification): | 47 def __get_notification(self, notification): |
51 if isinstance(notification, Notification): | 48 if isinstance(notification, Notification): |
52 return notification | 49 return notification |
53 elif isinstance(notification, int): | 50 elif isinstance(notification, int): |