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

OwnerOnly Middleware #89

Merged
merged 6 commits into from
Jun 26, 2022

Conversation

Gruce
Copy link
Contributor

@Gruce Gruce commented Jun 25, 2022

OwnerOnly middleware and applied to Kanban delete

OwnerOnly middleware and applied to Kanban delete
@WillTheDeveloper
Copy link
Owner

@Gruce Do you think since its only for one or two post methods that instead of making a whole middleware dedicated for it, what if we just added it to the controller that handles the requests?

Don't get me wrong, what you have done it awesome once I figured out what you changed.

Futhermore, not sure if it was done by accident or not, app.js and app.css has changed?

@Gruce
Copy link
Contributor Author

Gruce commented Jun 25, 2022

@WillTheDeveloper If we add it to the controller then it would not be reusable and can cause duplication in the code, since user_id (as owner) could be in multiple Models (like post, blog, etc..). We can improve it by making another option for admins.

About app.css and app.js once I executed npm run dev it has recompiled css files and js files. It could be skipped or maybe gitignore it.

@Gruce
Copy link
Contributor Author

Gruce commented Jun 25, 2022

I think we could also make group routes and assign this middleware to it, it would be more readable.

Signed-off-by: William Burton <willthedeveloper13@gmail.com>
Signed-off-by: William Burton <willthedeveloper13@gmail.com>
Signed-off-by: William Burton <willthedeveloper13@gmail.com>
Signed-off-by: William Burton <willthedeveloper13@gmail.com>
@WillTheDeveloper WillTheDeveloper self-requested a review June 26, 2022 07:39
@WillTheDeveloper WillTheDeveloper self-assigned this Jun 26, 2022
@WillTheDeveloper WillTheDeveloper added the enhancement New feature or request label Jun 26, 2022
Copy link
Owner

@WillTheDeveloper WillTheDeveloper left a comment

Choose a reason for hiding this comment

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

Looks good. Just going to double make sure everything is okay since your the first totally outside collaborator.

@WillTheDeveloper WillTheDeveloper merged commit fe3de61 into WillTheDeveloper:master Jun 26, 2022
Signed-off-by: WillTheDeveloper <willthedeveloper13@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants