Revision 7f31a7a3
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
795 | 795 |
else: |
796 | 796 |
return m.user_friendly_state_display() |
797 | 797 |
|
798 |
def non_owner_can_view(self, maybe_project): |
|
799 |
if maybe_project is None: |
|
800 |
return False |
|
801 |
project = maybe_project |
|
802 |
if self.is_associated(project): |
|
803 |
return True |
|
804 |
if project.is_deactivated(): |
|
805 |
return False |
|
806 |
return True |
|
807 |
|
|
798 | 808 |
|
799 | 809 |
class AstakosUserAuthProviderManager(models.Manager): |
800 | 810 |
|
b/snf-astakos-app/astakos/im/views.py | ||
---|---|---|
1247 | 1247 |
raise PermissionDenied(m) |
1248 | 1248 |
|
1249 | 1249 |
if (not is_owner and project_view and |
1250 |
(not project or |
|
1251 |
not project.is_approved() and not user.is_associated(project))): |
|
1250 |
not user.non_owner_can_view(project)): |
|
1252 | 1251 |
m = _(astakos_messages.NOT_ALLOWED) |
1253 | 1252 |
raise PermissionDenied(m) |
1254 | 1253 |
|
Also available in: Unified diff