gcgov/framework-service-user-crud
最新稳定版本:v1.0.3
Composer 安装命令:
composer require gcgov/framework-service-user-crud
包简介
Implement standard CRUD routes to manage the user collection. Even if your app doesn't provide a custom user model (`\app\models\user`), your auth or database service may provide you with a standard user model that implements (`\gcgov\framework\interfaces\auth\user`).
README 文档
README
Service to extend gcgov/framework
Primary purpose
- Implement standard CRUD routes to manage the user collection. Even if your app doesn't provide a custom user
model (
\app\models\user), your auth or database service may provide you with a standard user model that implements (\gcgov\framework\interfaces\auth\user).
User Model Standard and Customization
- The class fully qualified domain name returned by
\gcgov\framework\services\request::getUserClassFqdn()shall be used to select the correct user model for purposes of authentication services and the user crud service. The class returned byrequest::getUserClassFqdnmust implement\gcgov\framework\interfaces\auth\user. It will return the first class available in this list, in order.\app\models\user- Database provider user model
\gcgov\framework\services\mongodb\models\auth\user
Impact to application
- Router
- User Routes Adds standard CRUD user controller that will interface with the application's user model.
- Adds route
/user- GET all users; Required Roles:User.Read - Adds route
/user/{id}- GET one user by id or 'new'; Required Roles:User.Read - Adds route
/user/{id}- POST save user; Required Roles:User.Read,User.Write - Adds route
/user/{id}- DELETE user; Required Roles:User.Read,User.Write
- Adds route
- Adds authentication guard
- All routes in app with authentication=true will be guarded by this guard. The HTTP Authorization header is required and it's access token is validated by the jwt service.
- Provided user routes require authentication and
User.Read/User.Writeroles.
- User Routes Adds standard CRUD user controller that will interface with the application's user model.
Installation:
- Require using Composer https://packagist.org/packages/gcgov/framework-service-user-crud
- Add namespace
\gcgov\framework\services\usercrudto\app\app->registerFrameworkServiceNamespaces()
Implementation
统计信息
- 总下载量: 36
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-07