From 112bd1bfdb46fa50229d73e61297fd224fd6aa24 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 22 2015 08:49:24 +0000 Subject: Add a method to list all the ACLs in the database in the backend library --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 848fc7e..25ddbd9 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -2037,3 +2037,16 @@ def get_api_token(session, token_str): ) return query.first() + + +def get_acls(session): + """ Returns all the possible ACLs a token can have according to the + database. + """ + query = session.query( + model.ACL + ).order_by( + model.ACL.name + ) + + return query.all()