Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_roles(self):
roles = Role.find()
for role in roles:
try:
role.attributes['permissions'] = Role().find(role.id).permissions
except (ResourceNotFound, MethodNotAllowed):
print "WARN: Can't get permissions for roles."
print "WARN: This Redmine version doesn't support this feature."
break
return roles
def get_roles(self):
roles = Role.find()
for role in roles:
try:
role.attributes['permissions'] = Role().find(role.id).permissions
except (ResourceNotFound, MethodNotAllowed):
print "WARN: Can't get permissions for roles."
print "WARN: This Redmine version doesn't support this feature."
break
return roles