diff options
Diffstat (limited to 'public/app/models')
| -rw-r--r-- | public/app/models/Access_model.php | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/public/app/models/Access_model.php b/public/app/models/Access_model.php index 8a2e5ce..023d361 100644 --- a/public/app/models/Access_model.php +++ b/public/app/models/Access_model.php @@ -33,53 +33,6 @@ class Access_model } - /** get user (by index key) - * - * user detailed array - * includes all user properties + granted roles + privileges - * - * @param $id (int) : user id - * @param $value (string) - */ - public static function getUser($id) - { - $user = Registry::use('database')->query( - "SELECT user.*, - ( -- construct array (json) of roles granted to user - SELECT CONCAT( - '[', - GROUP_CONCAT(role.id), - ']' - ) - FROM `role` - WHERE role.id IN ( - SELECT user_role.role_id - FROM user_role - WHERE user_role.user_id = :id - ) - ) AS Roles_json - FROM user - WHERE id = :id", - [ ':id' => $id ] - )->getFirst(); - - - // if no user, return false - if ($user === false) return false; - - - // TODO: - // * merge root+sub privilede lists - // * convert json strings to php arrays - - - // TODO: - // cache user super array - - return $user; - } - - /** create user * * creates user record; |
