Skip to content

Commit

Permalink
fix permissions return type bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Apr 24, 2024
1 parent ba9a53a commit 3e33a1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arches/app/permissions/arches_standard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.core.exceptions import ObjectDoesNotExist
from arches.app.models.system_settings import settings
from arches.app.models.system_settings import settings, SystemSettings
from django.contrib.auth.models import User, Group
from django.contrib.gis.db.models import Model
from django.core.cache import caches
Expand Down Expand Up @@ -151,7 +151,7 @@ def get_nodegroups_by_perm(self, user, perms, any_perm=True):
any_perm -- True to check ANY perm in "perms" or False to check ALL perms
"""
return set(str(nodegroup.pk) for nodegroup in get_nodegroups_by_perm_for_user_or_group(user, perms, any_perm=any_perm))
return list(set(str(nodegroup.pk) for nodegroup in get_nodegroups_by_perm_for_user_or_group(user, perms, any_perm=any_perm)))

def check_resource_instance_permissions(self, user, resourceid, permission):
"""
Expand Down Expand Up @@ -384,8 +384,8 @@ def get_resource_types_by_perm(self, user, perms):
graphs = set()
nodegroups = self.get_nodegroups_by_perm(user, perms)
for node in Node.objects.filter(nodegroup__in=nodegroups).prefetch_related("graph"):
if node.graph.isresource and str(node.graph_id) != settings.SYSTEM_SETTINGS_RESOURCE_MODEL_ID:
graphs.add(node.graph)
if node.graph.isresource and str(node.graph_id) != SystemSettings.SYSTEM_SETTINGS_RESOURCE_MODEL_ID:
graphs.add(str(node.graph.pk))
return list(graphs)


Expand Down

0 comments on commit 3e33a1f

Please sign in to comment.