Download the PHP package chenmingwei/think-auth without Composer

On this page you can find all versions of the php package chenmingwei/think-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-auth

think-addons

The ThinkPHP5.1 Auth Package 一个ThinkPHP5.1 基于用户组的节点/菜单 权限管理类 部分代码参考 5ini99 / think-auth

安装

composer require chenmingwei/think-auth

配置

公共配置

导入数据表

think_ 为自定义的数据表前缀

原理

Auth权限认证是按规则进行认证。 在数据库中我们有

我们在think_auth_rule表中定义权限规则,在think_auth_group中定义用户组, 在think_auth_group_rule中定义哪些用户组与规格的关系,在think_auth_group_access中定义用户与用户组的关系。

下面举例说明:

我们要判断用户是否有显示一个操作按钮的权限, 首先定义一个规则, 在规则表中添加一个名为 show_button 的规则。 然后在用户组表添加一个用户组,定义这个用户组有show_button 的权限规则, 然后在用户组明细表定义 UID 为1 的用户 属于刚才这个的这个用户组。

使用

判断权限方法

Auth类也可以对节点进行认证,我们只要将规则名称,定义为节点名称就行了。 可以在公共控制器Base中定义initialize方法

这时候我们可以在数据库中添加的节点规则, 格式为: “模块/控制器名称/方法名称” 需要做权限控制的控制器都继承该基类

为了方便使用我们为Auth类拓展了几个实用方法


All versions of think-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chenmingwei/think-auth contains the following files

Loading the files please wait ....