How To Create User Permissions View To Dynamic Sidebar Menu AdminLTE

Seegatesite.com – I’ll share how to create a user permissions view to dynamic sidebar menu on adminLTE using Mysql. Someone asks through this website, how do I create a user permission view for my application. Because if I explain through the comment form will be very long at all, so on this occasion I try to write tutorial my way to create user permissions view for dynamic sidebar menu adminLTE.

How To Create User Permissions View To Dynamic Sidebar Menu Adminlte

Before starting , you should read Creating dynamic sidebar menu with Mysql and AdminLTE Bootstrap Template

Create 3 pieces of tables t_user, t_menu, t_menu_sub to accommodate the data

t_user table

Create Table T User How To Create User Permission View To Dynamic Sidebar Menu Adminlte

Fill the following data

r_menu table

Create Table R Menu How To Create User Permission View To Dynamic Sidebar Menu Adminlte

Fill the following data

r_menu_sub table

Create Table R Menu Sub How To Create User Permission View To Dynamic Sidebar Menu Adminlte

Fill the following data

Here I will not explain in detail how to create the overall form on adminLTE but I will only discuss how to create a user permissions view on adminLTE dynamic sidebar menu , if you want the full code please download at the end of the article.

Script on the adminLTE sidebar menu

Explanation :

The main script to create dynamic menu with user permissions view is the following script

$_SESSION[‘h_menu’] store h_menu value (user permission access field) from t_user table

in my example t_user table has the following value

Create User Permission Access

$_SESSION[‘h_menu’] has the value “1,2,3,4,5,6,7,8,9” > id_menu_sub. In my example, r_sub_menu has 9 rows of data with id_menu_sub 1,2,3,4,5,6,7,8,9

When table r_menu_sub looping, it will check if id_menu_sub match with user permission access value in array, if same it will show menu

Try to change the h_menu value to “1,3,4,5,7”. What will happen ?

Hopefully this brief tutorial can help you to create a user permissions view on adminLTE sidebar.

To get the full source code please download the following link

Thus article about How To Create User Permissions View To Dynamic Sidebar Menu AdminLTE 🙂

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

3 Comments

 Add your comment
  1. thanks
    very good

  2. password user ADMIN apa pak?

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.