From 6abf27468042b9b332ddeca3c76dbbb442925354 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Mon, 20 Aug 2018 08:55:04 -0700 Subject: [PATCH] Allow case insensitive role matching for cert permissions --- lemur/auth/permissions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemur/auth/permissions.py b/lemur/auth/permissions.py index e6d14408..68c48773 100644 --- a/lemur/auth/permissions.py +++ b/lemur/auth/permissions.py @@ -29,6 +29,9 @@ class CertificatePermission(Permission): needs = [RoleNeed('admin'), RoleNeed(owner), RoleNeed('creator')] for r in roles: needs.append(CertificateOwnerNeed(str(r))) + # Backwards compatibility with mixed-case role names + if str(r) != str(r).lower(): + needs.append(CertificateOwnerNeed(str(r).lower())) super(CertificatePermission, self).__init__(*needs)