Пример #1
0
def clear_permission_flag_cache(sender, instance, *args, **kwargs):
    """ m2mchanged
        If permissions for role had been changed then invalidate permission cache for all users in this role
    """
    from sphene.community.models import RoleMember

    user_ids = RoleMember.objects.filter(role=instance).values_list("user", flat=True)
    for user_id in user_ids:
        invalidate_cache_group_id("has_permission_flag_%s" % (user_id))
Пример #2
0
def clear_permission_flag_cache(sender, instance, *args, **kwargs):
    """ m2mchanged
        If permissions for role had been changed then invalidate permission cache for all users in this role
    """
    from sphene.community.models import RoleMember
    user_ids = RoleMember.objects.filter(role=instance).values_list('user',
                                                                    flat=True)
    for user_id in user_ids:
        invalidate_cache_group_id('has_permission_flag_%s' % (user_id))
Пример #3
0
def clear_permissions_cache_rm(sender, instance, *args, **kwargs):
    """ RoleMember
    """
    invalidate_cache_group_id("has_permission_flag_%s" % (instance.user_id))
Пример #4
0
def clear_permissions_cache_rm(sender, instance, *args, **kwargs):
    """ RoleMember
    """
    invalidate_cache_group_id('has_permission_flag_%s' % (instance.user_id))