@@ -26,7 +26,7 @@ public function indexAction()
26
26
{
27
27
$ this ->createTabs ()->activate ('reports ' );
28
28
29
- if ($ this ->hasPermission ('reporting/reports ' )) {
29
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
30
30
$ this ->addControl (new ButtonLink (
31
31
$ this ->translate ('New Report ' ),
32
32
Url::fromPath ('reporting/reports/new ' ),
@@ -43,6 +43,8 @@ public function indexAction()
43
43
$ reports = Report::on ($ this ->getDb ())
44
44
->withColumns (['report.timeframe.name ' ]);
45
45
46
+ $ this ->applyRestriction ($ reports , 'name ' );
47
+
46
48
$ sortControl = $ this ->createSortControl (
47
49
$ reports ,
48
50
[
@@ -58,13 +60,16 @@ public function indexAction()
58
60
foreach ($ reports as $ report ) {
59
61
$ url = Url::fromPath ('reporting/report ' , ['id ' => $ report ->id ])->getAbsoluteUrl ('& ' );
60
62
61
- $ tableRows [] = Html:: tag ( ' tr ' , [ ' href ' => $ url ], [
63
+ $ content = [
62
64
Html::tag ('td ' , null , $ report ->name ),
63
65
Html::tag ('td ' , null , $ report ->author ),
64
66
Html::tag ('td ' , null , $ report ->timeframe ->name ),
65
67
Html::tag ('td ' , null , $ report ->ctime ->format ('Y-m-d H:i ' )),
66
68
Html::tag ('td ' , null , $ report ->mtime ->format ('Y-m-d H:i ' )),
67
- Html::tag ('td ' , ['class ' => 'icon-col ' ], [
69
+ ];
70
+
71
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
72
+ $ content [] = Html::tag ('td ' , ['class ' => 'icon-col ' ], [
68
73
new Link (
69
74
new Icon ('edit ' ),
70
75
Url::fromPath ('reporting/report/edit ' , ['id ' => $ report ->id ]),
@@ -73,8 +78,10 @@ public function indexAction()
73
78
'data-no-icinga-ajax ' => true
74
79
]
75
80
)
76
- ])
77
- ]);
81
+ ]);
82
+ }
83
+
84
+ $ tableRows [] = Html::tag ('tr ' , ['href ' => $ url ], $ content );
78
85
}
79
86
80
87
if (! empty ($ tableRows )) {
@@ -110,7 +117,7 @@ public function indexAction()
110
117
111
118
public function newAction ()
112
119
{
113
- $ this ->assertPermission ('reporting/reports ' );
120
+ $ this ->assertPermission ('reporting/reports/modify ' );
114
121
$ this ->addTitleTab ($ this ->translate ('New Report ' ));
115
122
116
123
switch ($ this ->params ->shift ('report ' )) {
0 commit comments