From a1dba6e356794b01532b778083784e8abeac1b89 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jun 21 2021 15:18:59 +0000 Subject: fix is_admin still looking at cla_done previously, even if a user was in the admins group, and had signed the FPCA, and were a member of more than one group (CLA+1), they were not given access to the admin interface. This was due to the fact that the is_admin function was still checking for cla_done rather than signed_fpca. THis commit fixes this issue Signed-off-by: Ryan Lerch --- diff --git a/fedocal/__init__.py b/fedocal/__init__.py index aabfe62..4f0fb42 100644 --- a/fedocal/__init__.py +++ b/fedocal/__init__.py @@ -279,9 +279,10 @@ def set_session(): # Local function def is_admin(): """ Return whether the user is admin for this application or not. """ + if not authenticated() \ - or not flask.g.fas_user.cla_done \ - or len(flask.g.fas_user.groups) < 1: + or "signed_fpca" not in (flask.g.fas_user.groups or []) \ + or len(flask.g.fas_user.groups or []) < 2: return False admins = APP.config['ADMIN_GROUP']