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

"Unwatch app" button for common user #289

Closed
wants to merge 7 commits into from

Conversation

numbata
Copy link
Contributor

@numbata numbata commented Oct 24, 2012

Useful button, if your errbit-administrator is on vacation, or if you don't wanna read errbit mail any more.


def require_watcher_edit_priviledges
can_edit = current_user == @watcher.user || current_user.admin?
redirect_to(root_path) and return(false) unless can_edit
Copy link
Member

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).

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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.

@joshdvir
Copy link
Contributor

joshdvir commented Feb 6, 2013

Why not just talk to the Errbit admin and remove the user from receiving emails?

@numbata
Copy link
Contributor Author

numbata commented Feb 15, 2013

Unfortunately, admin can be busy to respond for this simple request. Especially, if you Errbit has 50+ projects and 100+ users.

@shingara
Copy link
Member

This implementation is not complete.

  1. If users is not watcher on this app, you don't need see button and don't failed if user unwatch project
  2. Add a button to watch project after all.

@shingara
Copy link
Member

I get this Pull request and update it on branch pr/289

shingara added a commit that referenced this pull request Sep 17, 2013
@shingara
Copy link
Member

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 shingara closed this Sep 17, 2013
@shime
Copy link

shime commented Nov 28, 2013

@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?

@shingara
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants