Feature #8488

Create an 'Involve' mechanism to private issues

Added by Bruno Medeiros 12 months ago. Updated 16 days ago.

Status:New Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Issues
Target version:-
Resolution:

Description

As requested by some people (http://www.redmine.org/issues/7414#note-16, http://www.redmine.org/issues/7412#note-3, and so on), sometimes we need to involve someone that cannot access an issue by "default rules". It can happen, for example, when a customer send a problem via email and we need to create a Redmine issue ourself, and give this customer access to the ticket.

I asked Jean-Phillipe on http://www.redmine.org/issues/7412#note-2 to extend the visibility of an issue to observers, and some people liked it, but it was not done because observe mechanism was designed for notification purposes (I now I agree it is not good, that's why I'm creating this feature request).

So my request is:
Create a involve mechanism where some roles can add people in an issue, in a very similar way they add an observer, and the added users have access to the issue the were involved.

private_issue_watchers.diff - Patch to allow users to be added as watchers to private issues and to (2.2 kB) Magnifier Justin Hahn, 2011-07-22 19:58

private_issue_watchers_FIXED.diff (2.8 kB) Magnifier Justin Hahn, 2011-07-28 17:48

private_issue_watchers_FIXED_1.3.diff - patch ported to branch 1.3-stable (2.9 kB) Magnifier Bruno Medeiros, 2011-12-09 14:10


Related issues

related to Feature #7412: Add an issue visibility level to each role Closed 2011-01-22
related to Feature #7414: Private issues Closed 2011-01-22
duplicated by Feature #9330: Watchers can not see the ticket status, if their role is ... Closed 2011-09-27

History

#1 Updated by Etienne Massip 12 months ago

  • Category set to Issues

#2 Updated by Anton Nepomnyaschih 12 months ago

Also, it would be cool to set visibility level for each comment, like in JIRA, where you can write somethings to a specific users group.

#3 Updated by Bruno Medeiros 12 months ago

Anton Nepomnyaschih wrote:

Also, it would be cool to set visibility level for each comment, like in JIRA, where you can write somethings to a specific users group.

Anton, There is already a feature request for that, #1554. Let's try don't mix requests.

#4 Updated by Anton Nepomnyaschih 12 months ago

Oh, you are right! Sorry!

#5 Updated by Terence Mill 12 months ago

+1

#6 Updated by Roman E. 12 months ago

+1

ty!

#7 Updated by Dmitry Salashnik 12 months ago

+1

#8 Updated by Pavel Konstantinov 11 months ago

+1

#9 Updated by Terence Mill 11 months ago

There is a CCC PLugin, which can add email adresses to be notified beyond redmine user base.

#10 Updated by Pavel Konstantinov 11 months ago

Terence Mill wrote:

There is a CCC PLugin, which can add email adresses to be notified beyond redmine user base.

This comment has no relation to the issue. This issue not about notification, but about issue access control

#11 Updated by Justin Hahn 10 months ago

While I've read the commentary about how watchers are the wrong mechanism for this, I needed this functionality to upgrade my company to v1.2.1 and meet our privacy needs. We'd previously been using the 'view own issues' patch in an old release which works roughly the same way.

Consequently, we cooked up this patch. It over-rides the addable_watcher_users method from acts_as_watchable to allow any user who can view issues to be added as a watcher, and then adds watchers of the issue to the visible named scope and the visible? method so that they can see operate on the issue.

I don't expect this patch to be accepted but if, like me, you can't wait another 4 years for this to get straightened out then maybe this will help you.

I've only tested this in the context of my environment, so I can't promise it won't do terrible things to yours. I'm not Rails wizard, but I think it's pretty low impact. Your Mileage May Vary. If it breaks, you get to keep both parts.

#12 Updated by mm MMY 10 months ago

Hello
After patching some problems happened :
Simple users cant access Activity page and give 500 Internal Error .
so i redo patch changes and all things work true .

#13 Updated by Justin Hahn 10 months ago

I have updated the patch for allowing watchers to see private issues to fix an issue with the Activity page -- there was a reference to Issue.visible_conditions in the journal model (which is related to the Activity page) which requires an include of the :watchers relation.

This updated patch should fix the issue with Activity giving a 500 Error.

#14 Updated by mm MMY 10 months ago

Well done .
Thanks .

#15 Updated by Colin Mollenhour 9 months ago

+1

In the meantime, thanks for sharing your patch, Justin!

#16 Updated by Alessio Cassibba 8 months ago

Thank you Bruno for sharing this, saved me a lot of time and effort.
Would be nice to see it implemented upstream as well.

#17 Updated by Bruno Medeiros 8 months ago

Alessio Cassibba wrote:

Thank you Bruno for sharing this, saved me a lot of time and effort.

I'm not the patch author, but you're welcome anyway :) The patch has been submitted by Justin Hahn.

#18 Updated by Martin G 8 months ago

+1

#19 Updated by Francesco Trigger 7 months ago

Justin Hahn wrote:

I have updated the patch for allowing watchers to see private issues to fix an issue with the Activity page -- there was a reference to Issue.visible_conditions in the journal model (which is related to the Activity page) which requires an include of the :watchers relation.

This updated patch should fix the issue with Activity giving a 500 Error.

Thanks Justin!! exactly what i was searching for!!! :)

#20 Updated by Francesco Trigger 7 months ago

Justin Hahn wrote:

I have updated the patch for allowing watchers to see private issues to fix an issue with the Activity page -- there was a reference to Issue.visible_conditions in the journal model (which is related to the Activity page) which requires an include of the :watchers relation.

This updated patch should fix the issue with Activity giving a 500 Error.

But now if the assignee is changed, the old assignee gets an 403 error if he is only allowed to see tickets as an assignee or ticket issuer.
Is there a way to redirect the user to the issues page after altering the ticket assignee?

#21 Updated by Francesco Trigger 7 months ago

Is there a way to add the one updating the issue automatically as a watcher?

#22 Updated by Bruno Medeiros 6 months ago

I guess I could port this patch to the 1.3-stable branch, but couldn't test yet. If someone could give some feedback on it, I would appreciate. :)

#23 Updated by Francesco Trigger 5 months ago

Bruno Medeiros wrote:

I guess I could port this patch to the 1.3-stable branch, but couldn't test yet. If someone could give some feedback on it, I would appreciate. :)

Hey Bruno,

i tested it on 1.3 and it seems to work like a charme :) Thank you very much. Only question i have, is it possible to send an email also out to the watcher, when he was added to the issue or the issue was updated?

Thank you very much for your work!! :)

Francesco

#24 Updated by Bruno Medeiros 5 months ago

Francesco Trigger wrote:

i tested it on 1.3 and it seems to work like a charme :) Thank you very much. Only question i have, is it possible to send an email also out to the watcher, when he was added to the issue or the issue was updated?

I don't believe we can send email when adding the observer/watcher, but redmine is supposed to send an email when the issue is updated if the proper config is set on the administration options.

Thank you very much for your work!! :)

You're welcome, but I'm not the author of the patch, just ported it. We all need to thank Justin Hahn! :)

#25 Updated by Anton Tsapov 2 months ago

mm MMY wrote:

After patching some problems happened :
Simple users cant access Activity page and give 500 Internal Error .

If I understand correctly, I have the same problem.
I use last patch: private_issue_watchers_FIXED_1.3.diff, but simple users can't access to links like this /projects/project_name/issues/report.

The error, that I've got:

Mysql::Error: Unknown column 'watchers.user_id' in 'where clause': select    s.id as status_id, 
                                                s.is_closed as closed, 
                                                j.id as tracker_id,
                                                count(issues.id) as total 
                                              from 
                                                  issues, projects, issue_statuses s, trackers j
                                              where 
                                                issues.status_id=s.id 
                                                and issues.tracker_id=j.id
                                                and issues.project_id=projects.id
                                                and (((projects.id = 2) AND (projects.status=1 AND projects.id
 IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))) AND (projects.id IN (1,43,34,65)
 OR ((projects.is_public = 1) OR  (projects.id IN (SELECT projects.id
                                 FROM projects, project_non_member_users
                                 WHERE projects.id = project_non_member_users.project_id
                                 AND (project_non_member_users.user_id = 886
                                  OR project_non_member_users.group_id IN (240,241,293,467,573,638,655,659,695,711,718,804,854))))
 AND ((issues.is_private = 0 OR issues.author_id = 886 OR issues.assigned_to_id
 IN (886,240,241,293,467,573,638,655,659,695,711,718,804,854) OR watchers.user_id = 886))) OR projects.id IN (13)))
                                              group by s.id, s.is_closed, j.id

Backtrace:

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/mysql_adapter.rb:324:in `execute'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/mysql_adapter.rb:639:in `select'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
 `select_all_without_query_cache'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
D:/Draft/redmine_svn/app/models/issue.rb:1073:in `count_and_group_by'
D:/Draft/redmine_svn/app/models/issue.rb:751:in `by_tracker'
D:/Draft/redmine_svn/app/controllers/reports_controller.rb:31:in `issue_report'

And when I run tests, some of them give the same errors.

#26 Updated by Florian Steiger 29 days ago

The patch 1.3 dont work for our updated Redmine 1.4.1 (from 1.2.1).
Are there any solutions?

Thanks for any hints.

#27 Updated by William Roush 24 days ago

+1, this is a major requirement when dealing with a part of the company that should only have access to issues that you've assigned to as watchers when they may only have "view own issues" permissions.

#28 Updated by Max Schwer 20 days ago

We need also a solution for 1.4.1
Is there somebody we can hire to solve this problem?

#29 Updated by Bruno Medeiros 16 days ago

Max Schwer wrote:

We need also a solution for 1.4.1
Is there somebody we can hire to solve this problem?

I would offer myself if I were something more than a rails noob.. :P

Also available in: Atom PDF