Skip to content

Commit f1c06ca

Browse files
authored
Merge pull request #31 from renderbox/develop
Release v0.2.11
2 parents 925f9cb + 37c477a commit f1c06ca

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

permafrost/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.2.10"
1+
VERSION = "0.2.11"

permafrost/backends.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55

66
class GroupSiteModelBackendMixin():
77

8-
def _get_group_permissions(self, user_obj):
8+
def _get_group_permissions(self, user_obj, obj=None, site=None):
99
'''
1010
Adds the SiteID for filtering Groups
1111
'''
12-
current_site = Site.objects.get_current()
12+
if site:
13+
current_site = site
14+
else:
15+
current_site = Site.objects.get_current()
16+
1317
user_groups_field = get_user_model()._meta.get_field('groups')
1418
user_groups_query = 'group__%s' % user_groups_field.related_query_name()
1519

16-
return Permission.objects.filter(**{user_groups_query: user_obj}).filter(group__permafrost_role__site=current_site) # TODO: Should it return Groups that do not have a Permafrost Role also?
20+
return Permission.objects.filter(**{user_groups_query: user_obj}, group__permafrost_role__site=current_site) # TODO: Should it return Groups that do not have a Permafrost Role also?
1721

1822

1923
class PermafrostModelBackend(GroupSiteModelBackendMixin, ModelBackend):

permafrost/templates/permafrost/permafrostrole_manage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{% block content %}
77

8-
<h1 class="my-3 text-gray-800">{% trans 'Roles & Permissions' %}</h1></a>
8+
<h1 class="my-3 text-gray-800">{% trans 'Roles & Permissions' %}</h1>
99

1010
<div class="row no-gutters shadow bg-white vh-main">
1111
<div class="col-3 d-flex flex-column flex-shrink-0 h-100 px-2 border-right-gray-300">

0 commit comments

Comments
 (0)