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
"Unwatch app" button for common user #289
Conversation
|
||
def require_watcher_edit_priviledges | ||
can_edit = current_user == @watcher.user || current_user.admin? | ||
redirect_to(root_path) and return(false) unless can_edit |
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.
I guess there is no need in and return(false)
.
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.
@lest, right, the redirect_to
will stop the destroy action from happening
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.
@lest @ndbroadbent redirect_to
will not stop the destroy, it will only set status/location/body and return true.
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/redirecting.rb#L65
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.
@numbata actually it will stop the destroy. http://guides.rubyonrails.org/action_controller_overview.html#filters
If a before filter renders or redirects, the action will not run. If there are additional filters scheduled to run after that filter they are also cancelled.
Why not just talk to the Errbit admin and remove the user from receiving emails? |
Unfortunately, admin can be busy to respond for this simple request. Especially, if you Errbit has 50+ projects and 100+ users. |
This implementation is not complete.
|
I get this Pull request and update it on branch pr/289 |
I merged this Pull request and improve it to add the not see unwatch button. We can't add a watch button because a user not watcher can see errors. I need doing another issue about that. Thanks |
@shingara what's the status of this? I would like to see something like this implemented since I get a lot of spam and can't unsubscribe from the projects I've left. Can you be more specific about the problem with this approach? Would you accept a new pull request adding this feature? Can I help? |
The problem is if you unwatch a project, you have not anymore access to this project. To have access again you need to be admin of this project or a watcher again. This features is not complete to me. We really need a full user administration in Errbit. But this features is currently on master branch. If you really need it. |
Useful button, if your errbit-administrator is on vacation, or if you don't wanna read errbit mail any more.