-
Notifications
You must be signed in to change notification settings - Fork 183
hide delete actions if not authorised, toggle between delete and undelete #177
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
Conversation
Controller/MessageController.php
Outdated
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.
Please revert this
|
thanks @stof for all his comments. Sorry about the layout changes. i'm still quite new to this, guess I really need to disable that in my IDE. I think I fixed all your remarks for now. |
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.
Please add a newline at the end of the file
|
Please squash all commits into a single commit: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html You'll need to do a force push after squashing. |
|
I'd also like to see this section improved, by using the Authorizer service to check if the user can actually delete threads before being given the buttons to actually delete[1], and checking the same permissions in the delete and undelete actions[2]. [1] You'll need to create a twig function called fos_message_can_delete which will proxy the call to Authorizer->canDeleteThread ps- thanks for the pull request :) |
|
@merk thanks a lot for that link, I almost got it right ;) You are right about the fact that my implementation is very very basic. But it was already very basic to start with. You got a delete thread action on a list with deleted messages... That being said I'm all for improving that section. I'll add an update with your proposed changes soon. Hopefully with very clean code and very nice formatting 😁 |
|
@merk About your second point This is already done in It seems that the whole package is designed to keep the controllers as small as possible. But if you do that security check in the deleter.php class then there is a problem with that interface. In my opinion there needs to be a @throws exception there in the phpdoc. So do you want me too...
Ow and the deleter is also in the configurable options... |
|
Thanks for looking into it. Dont add the check to the controller, just the template. I am working on v3 of this bundle with some BC breaks and plan on moving the ACL to wrappers around services like the Deleter, instead of doing it inside there. |
|
Updated the code
Thins i don't like:
|
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.
Extra line
|
Theres not much we can do about the mechanism naming at this point. I still think this is a valid 'deletion' from a users perspective. We can always introduce the concept of purging a message thread at a later date. |
|
true we could use purge for physically deleting a thread. I will fix your remarks later today and then I think its ready to merge |
|
If there are no more formatting issues, or function rename issues I think this is done. |
updates on twig modified threads_list try to fix the formatting changes try to fix the formatting changes fixed an extra space removed delete method readded docs hmm bad at english cs cs cs lol added new line to end of file updated tabs in threads list updates added function small updates
hide delete actions if not authorised, toggle between delete and undelete
|
Thanks! |
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.
this should probably be a Twig test rather than a twig function
This pull request