get rid of is_admin, fixes #676

This commit is contained in:
Shish
2019-09-29 19:00:51 +01:00
parent 0f4a0275b5
commit a7bddb1dac
27 changed files with 99 additions and 64 deletions

View File

@ -32,7 +32,7 @@ class Tips extends Extension
$this->getTip();
if ($event->page_matches("tips") && $user->is_admin()) {
if ($event->page_matches("tips") && $user->can(Permissions::TIPS_ADMIN)) {
switch ($event->get_arg(0)) {
case "list":
$this->manageTips();
@ -67,7 +67,7 @@ class Tips extends Extension
{
global $user;
if ($event->parent==="system") {
if ($user->is_admin()) {
if ($user->can(Permissions::TIPS_ADMIN)) {
$event->add_nav_link("tips", new Link('tips/list'), "Tips Editor");
}
}
@ -76,7 +76,7 @@ class Tips extends Extension
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->is_admin()) {
if ($user->can(Permissions::TIPS_ADMIN)) {
$event->add_link("Tips Editor", make_link("tips/list"));
}
}

View File

@ -63,7 +63,7 @@ class TipsTheme extends Themelet
"<th>Image</th>".
"<th>Text</th>";
if ($user->is_admin()) {
if ($user->can(Permissions::TIPS_ADMIN)) {
$html .= "<th>Action</th>";
}
@ -85,7 +85,7 @@ class TipsTheme extends Themelet
$del_link = "<a href='".make_link("tips/delete/".$tip['id'])."'>Delete</a>";
if ($user->is_admin()) {
if ($user->can(Permissions::TIPS_ADMIN)) {
$html .= "<td>".$del_link."</td>";
}