Merge pull request #3529 from FinnStutzenstein/hideIdentifierFieldDelegates

Hide identifier field in motion update form if the user is delegate
This commit is contained in:
Emanuel Schütze 2018-01-12 15:44:23 +01:00 committed by GitHub
commit 879e9bcbb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1961,10 +1961,12 @@ angular.module('OpenSlidesApp.motions.site', [
'Agenda',
'AgendaUpdate',
'motionId',
'operator',
'ErrorMessage',
'EditingWarning',
function($scope, $state, Motion, Category, Config, Mediafile, MotionForm,
Tag, User, Workflow, Agenda, AgendaUpdate, motionId, ErrorMessage, EditingWarning) {
Tag, User, Workflow, Agenda, AgendaUpdate, motionId, operator, ErrorMessage,
EditingWarning) {
Category.bindAll({}, $scope, 'categories');
Mediafile.bindAll({}, $scope, 'mediafiles');
Tag.bindAll({}, $scope, 'tags');
@ -1984,8 +1986,8 @@ angular.module('OpenSlidesApp.motions.site', [
// override default values for update form
for (var i = 0; i < $scope.formFields.length; i++) {
if ($scope.formFields[i].key == "identifier") {
// show identifier field
$scope.formFields[i].hide = false;
// show identifier field if the operator has manage permissions
$scope.formFields[i].hide = !operator.hasPerms('motions.can_manage');
}
if ($scope.formFields[i].key == "title") {
// get title of latest version