The alternative RBAC effect of thinkphp privilege

Source: Internet
Author: User
Tags webp

First take a look at the effect:

Admin maximum privileges Only one user, he will not participate in the judgment, directly show all

650) this.width=650; "Src=" http://mmbiz.qpic.cn/mmbiz/ uw17cgkmgbqg5yelpcckwoywdm4zkfapbmvgyh4rgsrsibhs79ogqbtib8gxbfibkeakvrrwpydymeunzkwvicroca/640?wx_fmt=png& Tp=webp&wxfrom=5&wx_lazy=1 "style=" Margin:0px;padding:0px;height:auto;width:auto; "alt=" 640?wx_fmt=png &tp=webp&wxfrom=5&wx_lazy= "/>

Effects, merchant Admin permissions, only show merchant admin navigation, other hidden or removed elements

650) this.width=650; "Src=" http://mmbiz.qpic.cn/mmbiz/ Uw17cgkmgbqg5yelpcckwoywdm4zkfapdesig8ia4wyc7dr0ecuvxmrov1ickxiapreuhfzbuia3pwyibi2aviahbsqa/640?wx_fmt=png &tp=webp&wxfrom=5&wx_lazy=1 "style=" Margin:0px;padding:0px;height:auto;width:auto; "alt=" 640?wx_fmt= Png&tp=webp&wxfrom=5&wx_lazy= "/>

The following small series of people to complete the above effect:

650) this.width=650; "Src=" http://mmbiz.qpic.cn/mmbiz/ uw17cgkmgbqg5yelpcckwoywdm4zkfapn6oxddkqetw20cc7ytef22mruj1swzoq143nfyylcbojaaszmd36ibw/640?wx_fmt=png&tp= Webp&wxfrom=5&wx_lazy=1 "style=" Margin:0px;padding:0px;height:auto;width:auto; "alt=" 640?wx_fmt=png& tp=webp&wxfrom=5&wx_lazy= "/>

650) this.width=650; "Src=" http://mmbiz.qpic.cn/mmbiz/ uw17cgkmgbqg5yelpcckwoywdm4zkfapbf8zvpicjrgaic34puvvccxdxr6wfudimmj8zicuic3qcsw8ablhfbtzpa/640?wx_fmt=png& Tp=webp&wxfrom=5&wx_lazy=1 "style=" Margin:0px;padding:0px;height:auto;width:auto; "alt=" 640?wx_fmt=png &tp=webp&wxfrom=5&wx_lazy= "/>
3, the login time according to the user login information to the user's permission group, and then find out the assigned permissions, according to the data table we can do as long as the Control List button display does not display, then we find the name of the method inside the data table, and then make it an array.
4, the permission group inside the permissions of the Cotroller method assigned to the foreground, the foreground use In_array to determine whether the name in the array


5, this is also the most critical step, in the body plus an automatic implementation of the
loop

Well, that's the way thinkphp alternative RBAC is implemented, Summary for Mao to call the alternative, because the effect is similar, but the method is not the same, so the small series to give him an alternative name! The little Buddy learns no, just knock it up and try it!


This article belongs to the thinking of PHP original article, like the small partners to help forward it, of course, you can also scan the following QR code, we will give you some of our usual summary of some small cases and share with you!

650) this.width=650; "Src=" http://mmbiz.qpic.cn/mmbiz/ Uw17cgkmgbpxts8uclqzyvb52ohfuvriaz1xciayxldg3rbzaoeg5msyvty5k37y5y6ichclib8bpwel41cgwnvkug/640?wx_fmt=jpeg &tp=webp&wxfrom=5&wx_lazy=1 "style=" Margin:0px;padding:0px;height:auto;width:auto; "alt=" 640?wx_fmt= Jpeg&tp=webp&wxfrom=5&wx_lazy "/>


The alternative RBAC effect of thinkphp privilege

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.