def get(self, req, lookup):
        """
        Returns all registered privileges.
        """

        _privileges = get_privilege_list()
        _privileges = sorted(_privileges, key=itemgetter('label'))

        return ListCursor(_privileges)
示例#2
0
    def get(self, req, lookup):
        """
        Returns all registered privileges.
        """

        _privileges = get_privilege_list()
        _privileges = sorted(_privileges, key=itemgetter('label'))

        return ListCursor(_privileges)
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name="ingest", label="Ingest")
        privilege(name="archive", label="Archive")

        self.assertIn("ingest", _privileges)
        self.assertIn("archive", _privileges)

        self.assertEqual(2, len(get_privilege_list()))
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name='ingest', label='Ingest')
        privilege(name='archive', label='Archive')

        self.assertIn('ingest', _privileges)
        self.assertIn('archive', _privileges)

        self.assertEqual(2, len(get_privilege_list()))
    def test_privilege_registration(self):
        _privileges.clear()

        privilege(name='ingest', label='Ingest')
        privilege(name='archive', label='Archive')

        self.assertIn('ingest', _privileges)
        self.assertIn('archive', _privileges)

        self.assertEqual(2, len(get_privilege_list()))
示例#6
0
def get_admin_privileges():
    """Get privileges for admin user."""
    return dict.fromkeys([p['name'] for p in get_privilege_list()], 1)
示例#7
0
def get_admin_privileges():
    """Get privileges for admin user."""
    return dict.fromkeys([p['name'] for p in get_privilege_list()], 1)
示例#8
0
 def get(self, req, lookup):
     """Return all registered privileges."""
     return ListCursor(get_privilege_list())
示例#9
0
 def get(self, req, lookup):
     """Return all registered privileges."""
     return ListCursor(get_privilege_list())