Renamed is_user_data_required to required_users. Fixed #3238.

This commit is contained in:
Norman Jäckel 2017-05-22 16:08:52 +02:00
parent ed0b1cef54
commit 913bec3e53
10 changed files with 25 additions and 25 deletions

View File

@ -22,9 +22,9 @@ class AgendaAppConfig(AppConfig):
from .config_variables import get_config_variables from .config_variables import get_config_variables
from .signals import ( from .signals import (
get_permission_change_data, get_permission_change_data,
is_user_data_required,
listen_to_related_object_post_delete, listen_to_related_object_post_delete,
listen_to_related_object_post_save) listen_to_related_object_post_save,
required_users)
from .views import ItemViewSet from .views import ItemViewSet
# Define config variables # Define config variables
@ -41,8 +41,8 @@ class AgendaAppConfig(AppConfig):
get_permission_change_data, get_permission_change_data,
dispatch_uid='agenda_get_permission_change_data') dispatch_uid='agenda_get_permission_change_data')
user_data_required.connect( user_data_required.connect(
is_user_data_required, required_users,
dispatch_uid='agenda_is_user_data_required') dispatch_uid='agenda_required_users')
# Register viewsets. # Register viewsets.
router.register(self.get_model('Item').get_collection_string(), ItemViewSet) router.register(self.get_model('Item').get_collection_string(), ItemViewSet)

View File

@ -54,7 +54,7 @@ def get_permission_change_data(sender, permissions, **kwargs):
break break
def is_user_data_required(sender, request_user, **kwargs): def required_users(sender, request_user, **kwargs):
""" """
Returns all user ids that are displayed as speakers in any agenda item Returns all user ids that are displayed as speakers in any agenda item
if request_user can see the agenda. This function may return an empty if request_user can see the agenda. This function may return an empty

View File

@ -19,7 +19,7 @@ class AssignmentsAppConfig(AppConfig):
from openslides.core.signals import permission_change, user_data_required from openslides.core.signals import permission_change, user_data_required
from openslides.utils.rest_api import router from openslides.utils.rest_api import router
from .config_variables import get_config_variables from .config_variables import get_config_variables
from .signals import get_permission_change_data, is_user_data_required from .signals import get_permission_change_data, required_users
from .views import AssignmentViewSet, AssignmentPollViewSet from .views import AssignmentViewSet, AssignmentPollViewSet
# Define config variables # Define config variables
@ -30,8 +30,8 @@ class AssignmentsAppConfig(AppConfig):
get_permission_change_data, get_permission_change_data,
dispatch_uid='assignments_get_permission_change_data') dispatch_uid='assignments_get_permission_change_data')
user_data_required.connect( user_data_required.connect(
is_user_data_required, required_users,
dispatch_uid='assignments_is_user_data_required') dispatch_uid='assignments_required_users')
# Register viewsets. # Register viewsets.
router.register(self.get_model('Assignment').get_collection_string(), AssignmentViewSet) router.register(self.get_model('Assignment').get_collection_string(), AssignmentViewSet)

View File

@ -16,7 +16,7 @@ def get_permission_change_data(sender, permissions=None, **kwargs):
yield from assignments_app.get_startup_elements() yield from assignments_app.get_startup_elements()
def is_user_data_required(sender, request_user, **kwargs): def required_users(sender, request_user, **kwargs):
""" """
Returns all user ids that are displayed as candidates (including poll Returns all user ids that are displayed as candidates (including poll
options) in any assignment if request_user can see assignments. This options) in any assignment if request_user can see assignments. This

View File

@ -23,8 +23,8 @@ class CoreAppConfig(AppConfig):
from .signals import ( from .signals import (
delete_django_app_permissions, delete_django_app_permissions,
get_permission_change_data, get_permission_change_data,
is_user_data_required,
permission_change, permission_change,
required_users,
user_data_required) user_data_required)
from .views import ( from .views import (
ChatMessageViewSet, ChatMessageViewSet,
@ -46,8 +46,8 @@ class CoreAppConfig(AppConfig):
get_permission_change_data, get_permission_change_data,
dispatch_uid='core_get_permission_change_data') dispatch_uid='core_get_permission_change_data')
user_data_required.connect( user_data_required.connect(
is_user_data_required, required_users,
dispatch_uid='core_is_user_data_required') dispatch_uid='core_required_users')
# Register viewsets. # Register viewsets.
router.register(self.get_model('Projector').get_collection_string(), ProjectorViewSet) router.register(self.get_model('Projector').get_collection_string(), ProjectorViewSet)

View File

@ -18,10 +18,10 @@ post_permission_creation = Signal()
permission_change = Signal() permission_change = Signal()
# This signal is sent if someone wants to see basic user data. Connected # This signal is sent if someone wants to see basic user data. Connected
# receivers may answer True if the user data is required for the request user # receivers may answer a set of user ids that are required for the request
# (this can be anything that is allowd as argument for utils.auth.has_perm()) # user (this can be anything that is allowd as argument for
# e. g. as motion submitter or assignment candidate. # utils.auth.has_perm()) e. g. as motion submitter or assignment candidate.
user_data_required = Signal(providing_args=['request_user', 'user_data']) user_data_required = Signal(providing_args=['request_user'])
def delete_django_app_permissions(sender, **kwargs): def delete_django_app_permissions(sender, **kwargs):
@ -52,7 +52,7 @@ def get_permission_change_data(sender, permissions, **kwargs):
yield Collection(core_app.get_model('ChatMessage').get_collection_string()) yield Collection(core_app.get_model('ChatMessage').get_collection_string())
def is_user_data_required(sender, request_user, **kwargs): def required_users(sender, request_user, **kwargs):
""" """
Returns all user ids that are displayed as chatters if request_user can Returns all user ids that are displayed as chatters if request_user can
use the chat. This function may return an empty set. use the chat. This function may return an empty set.

View File

@ -17,7 +17,7 @@ class MediafilesAppConfig(AppConfig):
# Import all required stuff. # Import all required stuff.
from openslides.core.signals import permission_change, user_data_required from openslides.core.signals import permission_change, user_data_required
from openslides.utils.rest_api import router from openslides.utils.rest_api import router
from .signals import get_permission_change_data, is_user_data_required from .signals import get_permission_change_data, required_users
from .views import MediafileViewSet from .views import MediafileViewSet
# Connect signals. # Connect signals.
@ -25,8 +25,8 @@ class MediafilesAppConfig(AppConfig):
get_permission_change_data, get_permission_change_data,
dispatch_uid='mediafiles_get_permission_change_data') dispatch_uid='mediafiles_get_permission_change_data')
user_data_required.connect( user_data_required.connect(
is_user_data_required, required_users,
dispatch_uid='mediafiles_is_user_data_required') dispatch_uid='mediafiles_required_users')
# Register viewsets. # Register viewsets.
router.register(self.get_model('Mediafile').get_collection_string(), MediafileViewSet) router.register(self.get_model('Mediafile').get_collection_string(), MediafileViewSet)

View File

@ -16,7 +16,7 @@ def get_permission_change_data(sender, permissions=None, **kwargs):
yield from mediafiles_app.get_startup_elements() yield from mediafiles_app.get_startup_elements()
def is_user_data_required(sender, request_user, **kwargs): def required_users(sender, request_user, **kwargs):
""" """
Returns all user ids that are displayed as uploaders in any mediafile Returns all user ids that are displayed as uploaders in any mediafile
if request_user can see mediafiles. This function may return an empty if request_user can see mediafiles. This function may return an empty

View File

@ -20,7 +20,7 @@ class MotionsAppConfig(AppConfig):
from openslides.core.signals import permission_change, user_data_required from openslides.core.signals import permission_change, user_data_required
from openslides.utils.rest_api import router from openslides.utils.rest_api import router
from .config_variables import get_config_variables from .config_variables import get_config_variables
from .signals import create_builtin_workflows, get_permission_change_data, is_user_data_required from .signals import create_builtin_workflows, get_permission_change_data, required_users
from .views import CategoryViewSet, MotionViewSet, MotionBlockViewSet, MotionPollViewSet, MotionChangeRecommendationViewSet, WorkflowViewSet from .views import CategoryViewSet, MotionViewSet, MotionBlockViewSet, MotionPollViewSet, MotionChangeRecommendationViewSet, WorkflowViewSet
# Define config variables # Define config variables
@ -32,8 +32,8 @@ class MotionsAppConfig(AppConfig):
get_permission_change_data, get_permission_change_data,
dispatch_uid='motions_get_permission_change_data') dispatch_uid='motions_get_permission_change_data')
user_data_required.connect( user_data_required.connect(
is_user_data_required, required_users,
dispatch_uid='motions_is_user_data_required') dispatch_uid='motions_required_users')
# Register viewsets. # Register viewsets.
router.register(self.get_model('Category').get_collection_string(), CategoryViewSet) router.register(self.get_model('Category').get_collection_string(), CategoryViewSet)

View File

@ -118,7 +118,7 @@ def get_permission_change_data(sender, permissions, **kwargs):
yield from motions_app.get_startup_elements() yield from motions_app.get_startup_elements()
def is_user_data_required(sender, request_user, **kwargs): def required_users(sender, request_user, **kwargs):
""" """
Returns all user ids that are displayed as as submitter or supporter in Returns all user ids that are displayed as as submitter or supporter in
any motion if request_user can see motions. This function may return an any motion if request_user can see motions. This function may return an