Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

permission direct children add_page fix

  • Loading branch information...
commit 2ceb7c195940797435bba3267f1c412598454793 1 parent 7ff461a
@digi604 digi604 authored
Showing with 0 additions and 60 deletions.
  1. +0 −60 cms/cache/signals.py
View
60 cms/cache/signals.py
@@ -1,60 +0,0 @@
-from django.conf import settings
-from django.db.models import signals
-from django.contrib.auth.models import User, Group
-
-from cms.models import PagePermission, GlobalPagePermission, Page
-from cms.cache.permissions import clear_user_permission_cache,\
- clear_permission_cache
-from cms.models import signals as cms_signals
-
-def pre_save_user(instance, raw, **kwargs):
- clear_user_permission_cache(instance)
-
-def pre_delete_user(instance, **kwargs):
- clear_user_permission_cache(instance)
-
-def pre_save_group(instance, raw, **kwargs):
- if instance.pk:
- for user in instance.user_set.filter(is_staff=True):
- clear_user_permission_cache(user)
-
-def pre_delete_group(instance, **kwargs):
- for user in instance.user_set.filter(is_staff=True):
- clear_user_permission_cache(user)
-
-def pre_save_pagepermission(instance, raw, **kwargs):
- if instance.user:
- clear_user_permission_cache(instance.user)
-
-def pre_delete_pagepermission(instance, **kwargs):
- if instance.user:
- clear_user_permission_cache(instance.user)
-
-def pre_save_globalpagepermission(instance, raw, **kwargs):
- if instance.user:
- clear_user_permission_cache(instance.user)
-
-def pre_delete_globalpagepermission(instance, **kwargs):
- if instance.user:
- clear_user_permission_cache(instance.user)
-
-def pre_save_delete_page(instance, **kwargs):
- clear_permission_cache()
-
-
-if settings.CMS_PERMISSION:
- # TODO: will this work also with PageUser and PageGroup??
- signals.pre_save.connect(pre_save_user, sender=User)
- signals.pre_delete.connect(pre_delete_user, sender=User)
-
- signals.pre_save.connect(pre_save_group, sender=Group)
- signals.pre_delete.connect(pre_delete_group, sender=Group)
-
- signals.pre_save.connect(pre_save_pagepermission, sender=PagePermission)
- signals.pre_delete.connect(pre_delete_pagepermission, sender=PagePermission)
-
- signals.pre_save.connect(pre_save_globalpagepermission, sender=GlobalPagePermission)
- signals.pre_delete.connect(pre_delete_globalpagepermission, sender=GlobalPagePermission)
-
- signals.pre_save.connect(pre_save_delete_page, sender=Page)
- signals.pre_delete.connect(pre_save_delete_page, sender=Page)
Please sign in to comment.
Something went wrong with that request. Please try again.