Project

General

Profile

Bug #8558

Change to the admin roles permissions are not applied

Added by Benjamin Dauvergne almost 4 years ago. Updated over 1 year ago.

Status:
Fermé
Priority:
Normal
Category:
-
Target version:
Start date:
08 Oct 2015
Due date:
% Done:

100%

Patch proposed:
No
Planning:
No

Description

This code in update_ous_admin_roles() prevents update_ou_admin role to be called for all ou:

    ou_ids = ou_all.values_list('id', flat=True)
...
    perm_ids_with_role = Role.objects.filter(
        admin_scope_ct=ContentType.objects.get_for_model(Permission)
        ).values_list('admin_scope_id')
    ou_admin_perms = Permission.objects.filter(
        operation__slug='view',
        target_ct=ContentType.objects.get_for_model(OU), id__in=perm_ids_with_role)
    ou_ids_with_perm = ou_admin_perms.values_list('target_id', flat=True)
...
    for ou in OU.objects.filter(id__in=set(ou_ids)-set(ou_ids_with_perm)):
        update_ou_admin_roles(ou)

But it prevents too much.


Related issues

Related to Authentic 2 - Bug #8565: NameError: global name 'ou_admin_perms' is not defined Fermé 08 Oct 2015

Associated revisions

Revision a058c274 (diff)
Added by Benjamin Dauvergne almost 4 years ago

a2_rbac/management: remove broken optimization in update_ous_admin_roles (fixes #8558)

Trying to filter ou before updating their admin roles fails because the
filtering is too simple, so we lack some chanes, for example adding the
vire permission on organizational unit to all admin roles.

Revision 55c57090 (diff)
Added by Benjamin Dauvergne almost 4 years ago

a2_rbac: fix undefined variables errors (fixes #8558)

Also some pep8 enhancements.

History

#2 Updated by Benjamin Dauvergne almost 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Nouveau to Résolu (à déployer)

#3 Updated by Frédéric Péters almost 4 years ago

  • Related to Bug #8565: NameError: global name 'ou_admin_perms' is not defined added

#5 Updated by Benjamin Dauvergne over 3 years ago

  • Status changed from Résolu (à déployer) to Solution déployée

#7 Updated by Benjamin Dauvergne over 1 year ago

  • Status changed from Solution déployée to Fermé

Also available in: Atom PDF