@@ -24,7 +24,7 @@ public function indexAction()
24
24
{
25
25
$ this ->createTabs ()->activate ('reports ' );
26
26
27
- if ($ this ->hasPermission ('reporting/reports ' )) {
27
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
28
28
$ this ->addControl (new ButtonLink (
29
29
$ this ->translate ('New Report ' ),
30
30
Url::fromPath ('reporting/reports/new ' ),
@@ -41,16 +41,21 @@ public function indexAction()
41
41
$ reports = Report::on ($ this ->getDb ())
42
42
->withColumns (['report.timeframe.name ' ]);
43
43
44
+ $ this ->applyRestriction ($ reports , 'name ' );
45
+
44
46
foreach ($ reports as $ report ) {
45
47
$ url = Url::fromPath ('reporting/report ' , ['id ' => $ report ->id ])->getAbsoluteUrl ('& ' );
46
48
47
- $ tableRows [] = Html:: tag ( ' tr ' , [ ' href ' => $ url ], [
49
+ $ content = [
48
50
Html::tag ('td ' , null , $ report ->name ),
49
51
Html::tag ('td ' , null , $ report ->author ),
50
52
Html::tag ('td ' , null , $ report ->timeframe ->name ),
51
53
Html::tag ('td ' , null , $ report ->ctime ->format ('Y-m-d H:i ' )),
52
54
Html::tag ('td ' , null , $ report ->mtime ->format ('Y-m-d H:i ' )),
53
- Html::tag ('td ' , ['class ' => 'icon-col ' ], [
55
+ ];
56
+
57
+ if ($ this ->hasPermission ('reporting/reports/modify ' )) {
58
+ $ content [] = Html::tag ('td ' , ['class ' => 'icon-col ' ], [
54
59
new Link (
55
60
new Icon ('edit ' ),
56
61
Url::fromPath ('reporting/report/edit ' , ['id ' => $ report ->id ]),
@@ -59,8 +64,10 @@ public function indexAction()
59
64
'data-no-icinga-ajax ' => true
60
65
]
61
66
)
62
- ])
63
- ]);
67
+ ]);
68
+ }
69
+
70
+ $ tableRows [] = Html::tag ('tr ' , ['href ' => $ url ], $ content );
64
71
}
65
72
66
73
if (! empty ($ tableRows )) {
@@ -96,7 +103,7 @@ public function indexAction()
96
103
97
104
public function newAction ()
98
105
{
99
- $ this ->assertPermission ('reporting/reports ' );
106
+ $ this ->assertPermission ('reporting/reports/modify ' );
100
107
$ this ->addTitleTab ($ this ->translate ('New Report ' ));
101
108
102
109
$ form = (new ReportForm ())
0 commit comments