ソースを参照

added info to doku

Example for usage with roles defined in configuration file (non-db soles setup)
repher 10 年 前
コミット
40b64afbae
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.
  *