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