From c6b4b80f1514854ee52fce9ee8a7795379adf3f7 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Mon, 21 May 2018 20:06:06 -0300 Subject: [PATCH] fix access to admin --- src/admin/class-tainacan-admin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/admin/class-tainacan-admin.php b/src/admin/class-tainacan-admin.php index 910ef8314..14924016a 100644 --- a/src/admin/class-tainacan-admin.php +++ b/src/admin/class-tainacan-admin.php @@ -28,10 +28,14 @@ class Admin { } function add_admin_menu() { + $dummyEntity = new \Tainacan\Entities\Taxonomy(); + // a capability everybody bu subscriber have. + // Maybe we will create a specific cap to view_admin later + $entity_cap = $dummyEntity->get_capabilities()->edit_posts; $page_suffix = add_menu_page( __( 'Tainacan', 'tainacan' ), __( 'Tainacan', 'tainacan' ), - 'edit_posts', + $entity_cap, $this->menu_slug, array( &$this, 'admin_page' ), plugin_dir_url( __FILE__ ) . 'images/tainacan_logo_symbol.svg'