Check if user is allowed to see detail view link in agenda list.
Fixes #1886
This commit is contained in:
parent
352e32334e
commit
fc22711a9c
@ -71,12 +71,13 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
||||
'$scope',
|
||||
'$http',
|
||||
'$state',
|
||||
'operator',
|
||||
'ngDialog',
|
||||
'Agenda',
|
||||
'AgendaTree',
|
||||
'Customslide',
|
||||
'Projector',
|
||||
function($scope, $http, $state, ngDialog, Agenda, AgendaTree, Customslide, Projector) {
|
||||
function($scope, $http, $state, operator, ngDialog, Agenda, AgendaTree, Customslide, Projector) {
|
||||
// Bind agenda tree to the scope
|
||||
$scope.$watch(function () {
|
||||
return Agenda.lastModified();
|
||||
@ -85,6 +86,20 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
||||
});
|
||||
$scope.alert = {};
|
||||
|
||||
// check open permission
|
||||
$scope.isAllowedToSeeOpenLink = function (item) {
|
||||
var collection = item.content_object.collection;
|
||||
switch (collection) {
|
||||
case 'core/customslide':
|
||||
return operator.hasPerms('core.can_manage_projector');
|
||||
case 'motions/motion':
|
||||
return operator.hasPerms('motions.can_see');
|
||||
case 'assignments/assignment':
|
||||
return operator.hasPerms('assignments.can_see');
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// open new dialog
|
||||
$scope.newDialog = function () {
|
||||
ngDialog.open({
|
||||
|
@ -135,9 +135,12 @@
|
||||
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false"
|
||||
style="padding-left: calc(8px + {{ item.parentCount }}*15px)">
|
||||
<strong>
|
||||
<a href="" ng-click="open(item)">
|
||||
<a ng-show="isAllowedToSeeOpenLink(item)" href="" ng-click="open(item)">
|
||||
{{ item.getListViewTitle() }}
|
||||
</a>
|
||||
<span ng-hide="isAllowedToSeeOpenLink(item)">
|
||||
{{ item.getListViewTitle() }}
|
||||
</span>
|
||||
</strong>
|
||||
<span ng-if="item.is_hidden" title="{{ 'Internal item' | translate }}"><i class="fa fa-ban"></i></span>
|
||||
<div ng-if="item.comment">
|
||||
|
Loading…
Reference in New Issue
Block a user