Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Dec 11, 2021
1 parent cba3ef0 commit a8f8586
Show file tree
Hide file tree
Showing 39 changed files with 50 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class LoginProxyPasswordGrantRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'permissions' => null,
'roles' => null,
'permissions' => '',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class LogoutRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'permissions' => null,
'roles' => null,
'permissions' => '',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class RefreshProxyRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'permissions' => null,
'roles' => null,
'permissions' => '',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @apiGroup Authentication
* @apiName GetAuthenticatedUser
*
* @api {GET} /v1/profile Find Logged-in User data (Profile Information)
* @api {GET} /v1/profile Get Profile
* @apiDescription Find the user details of the logged-in user from its Token. (without specifying his ID)
*
* @apiVersion 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @apiDescription Login Users using their email and password, without client_id and client_secret.
*
* @apiVersion 1.0.0
* @apiPermission none
*
* @apiParam {String} email user email
* @apiParam {String} password user password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* You must have client ID and secret first. You can generate them by creating new Client in our Web App.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission none
*
* @apiParam {String} client_id
* @apiParam {String} client_secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @apiDescription Login Users using their username and passwords. (For First-Party Clients)
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission none
*
* @apiParam {String} username user email
* @apiParam {String} password user password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @apiDescription Get new tokens given a valid refresh token is provided.
*
* @apiVersion 1.0.0
* @apiPermission none
*
* @apiParam {String} [refresh_token] The refresh Token
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @apiParam {String} [name] min:2|max:50
* @apiParam {String="male,female,unspecified"} [gender]
* @apiParam {Date} [birth] format: Y-m-d / e.g. 2015-10-15
* @apiParam {String} verification_url requireIf:email_verification_required|url|in:allowed-verify-email-urls
* @apiParam {String} [verification_url] requireIf:email_verification_required|url|in:allowed-verify-email-urls
*
* @apiUse UserSuccessSingleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @apiName ResetPassword
*
* @api {GET/POST} /v1/password/reset Reset Password
* @apiDescription Resets a password for an user.
* @apiDescription Resets password of a user.
*
* @apiVersion 1.0.0
* @apiPermission none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Containers\AppSection\Authorization\Data\Seeders;

use App\Containers\AppSection\Authentication\Tasks\CreateUserByCredentialsTask;
use App\Containers\AppSection\Authorization\Tasks\AssignRolesToUserTask;
use App\Containers\AppSection\User\Actions\CreateAdminAction;
use App\Ship\Exceptions\CreateResourceFailedException;
use App\Ship\Parents\Seeders\Seeder;
Expand All @@ -13,6 +11,7 @@ class AuthorizationDefaultUsersSeeder_4 extends Seeder
{
/**
* @throws CreateResourceFailedException
* @throws Throwable
*/
public function run(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AssignRolesToUserRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-admins-access',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class AttachPermissionsToRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class CreateRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class DeleteRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class DetachPermissionsFromRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class FindPermissionRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class FindRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class GetAllPermissionsRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class GetAllRolesRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class RevokeRolesFromUserRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-admins-access',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class SyncPermissionsOnRoleRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-roles',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class SyncUserRolesRequest extends Request
* Define which Roles and/or Permissions has access to this request.
*/
protected array $access = [
'roles' => '',
'permissions' => 'manage-admins-access',
'roles' => '',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* `/roles/sync` endpoint instead.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-admins-access', 'roles' => '']
*
* @apiParam {Number} user_id User ID
* @apiParam {Array} roles_ids Role ID or Array of Roles ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* `/permissions/sync` endpoint instead.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiParam {String} role_id Role ID
* @apiParam {Array} permissions_ids Permission ID or Array of Permissions ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @api {post} /v1/roles Create a Role
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiParam {String} name Unique Role Name
* @apiParam {String} [description]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @apiDescription Delete Role by ID
*
* @apiVersion 1.0.0
* @apiPermission Authenticated Role
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 202 OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* @apiName DetachPermissionFromRole
* @api {post} /v1/permissions/detach Detach Permissions from Role
* @apiDescription Detach existing permission from role. This endpoint does not sync the role
* It just detach the passed permissions from the role. So make sure
* to never send an non attached permission since it will cause an error.
* It just detaches the passed permissions from the role. So make sure
* to never send a non-attached permission since it will cause an error.
* To sync (update) all existing permissions with the new ones use
* `/permissions/sync` endpoint instead.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiParam {String} role_id Role ID
* @apiParam {String-Array} permissions_ids Permission ID or Array of Permissions ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @api {get} /v1/permissions/:id Find a Permission by ID
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiUse PermissionSuccessSingleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @api {get} /v1/roles/:id Find a Role by ID
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiUse RoleSuccessSingleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @api {get} /v1/permissions Get All Permission
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiUse GeneralSuccessMultipleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @api {get} /v1/roles Get All Roles
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiUse GeneralSuccessMultipleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* `/roles/sync` endpoint instead.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-admins-access', 'roles' => '']
*
* @apiParam {Number} user_id user ID
* @apiParam {Array} roles_ids Role ID or Array of Role ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* The sync endpoint will override all existing role permissions with the new
* one sent to this endpoint.
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-roles', 'roles' => '']
*
* @apiParam {String} role_id Role ID
* @apiParam {Array} permissions_ids Permission ID or Array of Permissions ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* one sent to this endpoint.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'manage-admins-access', 'roles' => '']
*
* @apiParam {Number} user_id User ID
* @apiParam {Array} roles_ids Role ID or Array of Roles ID's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
* @apiDescription Delete users of any type (Admin, Client...)
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'delete-users', 'roles' => ''] | Resource Owner
*
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 202 OK
* {
* "message": "User (4) Deleted Successfully."
* }
* HTTP/1.1 204 No Content
* {}
*/

use App\Containers\AppSection\User\UI\API\Controllers\DeleteUserController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @apiDescription Find a user by its ID
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'delete-users', 'roles' => ''] | Resource Owner
*
* @apiUse UserSuccessSingleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* can use `/clients`. And for all "Admins" only you can use `/admins`.
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'list-users', 'roles' => ''] | Resource Owner
*
* @apiUse GeneralSuccessMultipleResponse
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* @api {patch} /v1/users/:id Update User
*
* @apiVersion 1.0.0
* @apiPermission Authenticated
* @apiPermission Authenticated ['permissions' => 'list-users', 'roles' => ''] | Resource Owner
*
* @apiParam {String} [password] min:6|max:40
* @apiParam {String} [name] min:2|max:50
* @apiParam {String="male,female,unspecified"} [gender]
* @apiParam {Date} [birth] format: Y-m-d / e.g. 2015-10-15
* @apiParam {String} [password] min:6|max:40
* @apiParam {String} [name] min:2|max:50
* @apiParam {String="male,female,unspecified"} [gender]
* @apiParam {Date} [birth] format: Y-m-d / e.g. 2015-10-15
*
* @apiUse UserSuccessSingleResponse
*/
Expand Down

0 comments on commit a8f8586

Please sign in to comment.