Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Metronic : Permission and Role Laravel


how is pattern in an array for permission and role ? it can config in config/menu.php I guess. But I don't know how ?

ps. Sorry My English isn’t that good


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Adobez,

If you are using this plugin as a permission/role module, you can use the "role" or "permission" option in the menu.


Example of menu config below.


array(
"title" => "Troubleshoot",
"path" => "documentation/getting-started/troubleshoot",
"role" => "admin",
),


In the menu class, we added condition to check the menu item for current auth user. The menu will be removed if the current has no permission to view it.
app/Core/Adapters/Menu.php


$user->hasAnyRole((array) $value["role"])


<img src=" alt="o3i-Kp-UTGPm-VXv-Go-NB2-Y-Mpn34-Bm4j-XTwpw" border="0">

Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(