summaryrefslogtreecommitdiff
path: root/core/helpers/core_menu.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/helpers/core_menu.php')
-rw-r--r--core/helpers/core_menu.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php
index e4a3dd92..69398302 100644
--- a/core/helpers/core_menu.php
+++ b/core/helpers/core_menu.php
@@ -32,9 +32,8 @@ class core_menu_Core {
->url(url::site("albums/1")));
$item = $theme->item();
- $user = Session::instance()->get("user", null);
- if ($user) {
- // @todo need to do a permission check here
+
+ if (access::can("edit", $item)) {
$menu->append(
Menu::factory("submenu")
->id("options_menu")
@@ -50,19 +49,19 @@ class core_menu_Core {
->label(_("Add album"))
->url(url::site("form/add/albums/$item->id"))));
+
$admin_menu = Menu::factory("submenu")
->id("admin_menu")
->label(_("Admin"));
$menu->append($admin_menu);
- // @todo need to do a permission check here
$admin_menu->append(
Menu::factory("dialog")
->id("edit")
->label(_("Edit"))
->url(url::site("form/edit/{$item->type}s/$item->id")));
- if ($user->admin) {
+ if (user::active()->admin) {
$admin_menu->append(
Menu::factory("link")
->id("site_admin")