浏览代码

Merge pull request #147 from repher/patch-1

added info to doku
Mark S. 10 年之前
父节点
当前提交
2e3dc25a65
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/Auth/AuthUserTrait.php

+ 7 - 0
src/Auth/AuthUserTrait.php

@@ -29,6 +29,13 @@ if (!defined('USER_RIGHT_KEY')) {
  * 	- `Auth.User.Role` (multi - flat array of roles, or array role data)
  * and can be adjusted via constants and defined().
  * Same goes for Right data.
+ * 
+ * If roles are defined in configuration file (non-db roles setup) the constant
+ * `USER_ROLE_KEY` has to be defined in `bootstrap.php`.
+ * ```
+ * // if role key in User model is role_id
+ * define('USER_ROLE_KEY', 'role_id');
+ * ```
  *
  * Note: This uses AuthComponent internally to work with both stateful and stateless auth.
  *