-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
OwnerOnly Middleware #89
Conversation
OwnerOnly middleware and applied to Kanban delete
@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? |
@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 |
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>
There was a problem hiding this 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.
Signed-off-by: WillTheDeveloper <willthedeveloper13@gmail.com>
OwnerOnly middleware and applied to Kanban delete