Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[finishes #187354254] permissions and role implementation #47

Merged
merged 1 commit into from
May 15, 2024

Conversation

JeanIrad
Copy link
Contributor

@JeanIrad JeanIrad commented May 1, 2024

Purpose

implementing the functionalities where the Admin should be able to assign various users to various roles,
and each role should have permissions dedicated to it.

Changes Made

created a permission table and other permission controllers

Testing Instructions

by providing the right parameters as described in the readme file, one can have a sound test this PR

Related Issues

Not yet

Checklist

Please review the following checklist and make sure all tasks are complete before submitting:

  • Code follows the project's coding standards
  • Changes are covered by tests
  • Documentation is updated (if applicable)
  • All tests pass

Copy link
Collaborator

@Favor-star Favor-star left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't you create a modal for it?!
Definitely it's a work in a progress.

@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch from 1d9e6bd to fa1ee4c Compare May 6, 2024 10:08
@JeanIrad
Copy link
Contributor Author

JeanIrad commented May 6, 2024

Won't you create a modal for it?! Definitely it's a work in a progress.

which model?

@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch 5 times, most recently from e0564f4 to ca8aaf5 Compare May 9, 2024 09:10
@JeanIrad JeanIrad added ready and removed WIP labels May 9, 2024
@niyontwali niyontwali requested a review from Favor-star May 10, 2024 15:58
@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch 4 times, most recently from 57ef4c5 to 94d7b92 Compare May 11, 2024 20:12
Copy link
Collaborator

@amin-leon amin-leon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have role called vendor? we are using seller?

src/database/models/role.ts Show resolved Hide resolved
@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch from 94d7b92 to 0ad5698 Compare May 13, 2024 17:15
@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch 3 times, most recently from 046a67f to 2a662a0 Compare May 14, 2024 19:41
inishes role and permission assigning functionality
	modified:   package.json
	new file:   src/controllers/permissionController.ts
	modified:   src/controllers/roleControllers.ts
	new file:   src/database/migrations/20240401004514-create-permissions-table.js
	modified:   src/database/migrations/20240413203456-create-role.js
	renamed:    src/database/migrations/20240425195548-create-user.js -> src/database/migrations/20240435195548-create-user.js
	new file:   src/database/migrations/20240505075748-role_permissions.js
	new file:   src/database/models/permission.ts
	modified:   src/database/models/role.ts
	new file:   src/database/models/rolePermissions.ts
	modified:   src/database/models/user.ts
	modified:   src/database/seeders/20240427082911-create-default-role.js
	new file:   src/database/seeders/20240501105101-permissions.js
	new file:   src/database/seeders/20240502080814-create-default-users.js
	new file:   src/database/seeders/20240502093711-role_permissions.js
	new file:   src/docs/permissions.yaml
	modified:   src/middlewares/authMiddlewares.ts
	modified:   src/routes/index.ts
	new file:   src/routes/permissionRoute.ts
	modified:   src/routes/roleRoute.ts
	new file:   src/test/permissionController.test.ts

 Changes to be committed:
	new file:   src/controllers/permissionController.ts
	modified:   src/controllers/roleControllers.ts
	modified:   src/controllers/userController.ts
	new file:   src/controllers/vendorRequestController.ts
	modified:   src/database/migrations/20240413203456-create-role.js
	modified:   src/database/migrations/20240425195548-create-user.js
	new file:   src/database/migrations/20240501104514-create-permissions-table.js
	new file:   src/database/migrations/20240505075748-role_permissions.js
	new file:   src/database/migrations/20240506142003-create_vendor_request_table.js	modified:   src/database/models/index.ts
	new file:   src/database/models/order.ts
	new file:   src/database/models/orderItem.ts
	new file:   src/database/models/vendorRequest.ts
	modified:   src/database/seeders/20240427082911-create-default-rol
e.js
	deleted:    src/database/seeders/20240429200629-add-seller-role.js	new file:   src/database/seeders/20240501105101-permissions.js
	modified:   src/database/seeders/20240501163745-User.js
	new file:   src/docs/permissions.yaml
	new file:   src/docs/vendor.yaml
	modified:   src/middlewares/authMiddlewares.ts
	modified:   src/routes/index.ts	new file:   src/routes/permissionRoute.ts
	modified:   src/routes/roleRoute.ts
	new file:   src/routes/vendorRequestRoute.ts
	modified:   src/server.ts
@JeanIrad JeanIrad force-pushed the 187354254-ft-assigning-permission-role branch from 2a662a0 to ee17991 Compare May 14, 2024 19:52
@niyontwali niyontwali merged commit 1beffd7 into develop May 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants