Set the role type to SYSTEM for auto generated roles, which is similar to the default behavior

This commit is contained in:
Jelle Scholtalbers
2018-03-16 11:56:05 +01:00
parent ebb7be8d0e
commit be02063c3f
+2 -2
View File
@@ -777,7 +777,7 @@ class GalaxyRBACAgent(RBACAgent):
return role
def get_role(self, name, type=None):
type = type or self.model.Role.types.ADMIN
type = type or self.model.Role.types.SYSTEM
# will raise exception if not found
return self.sa_session.query(self.model.Role) \
.filter(and_(self.model.Role.table.c.name == name,
@@ -785,7 +785,7 @@ class GalaxyRBACAgent(RBACAgent):
.one()
def create_role(self, name, description, in_users, in_groups, create_group_for_role=False, type=None):
type = type or self.model.Role.types.ADMIN
type = type or self.model.Role.types.SYSTEM
role = self.model.Role(name=name, description=description, type=type)
self.sa_session.add(role)
# Create the UserRoleAssociations