Project

General

Profile

Actions

Patch #14318

closed

Watchers Alerted To Changes But Cannot See Issues (potentially)

Added by Brett Patterson over 11 years ago. Updated 2 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues permissions
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

At our company we try to keep things private so user A cannot see tickets from user B. With this in mind, I set the Issues Visibility setting for all user groups to be the assigned to or created by me value. This has the draw back that if I add a watcher because it may not directly implicate that person but they need to be kept in the loop (e.g. supervisor/boss), they would get the email updates but can't see the issue within Redmine itself.

So I added two more options to the Issue Visibility dropdown:

  1. Created by, Assigned to, or watched by the user
  2. Created by, Assigned to, watched by, or contributed to by the user

The contributed to just looks at the journals of the issues to see if you've modified the issue in some way (meaning you now have a vested interest in the issue).

Attached is the patch I developed against the core of 2.2.3. I haven't tested it in the 3.x line yet, but hope to soon.

Hopefully this could be wrapped into 2.2.5 or the next 3.x release.


Files

allow_watchers_and_contributers_access_to_issues.patch (3.31 KB) allow_watchers_and_contributers_access_to_issues.patch Brett Patterson, 2013-06-19 22:13
roles-edit.png (35.9 KB) roles-edit.png screenshot (roles/edit) Go MAEDA, 2016-01-16 07:05
allow_watchers_and_contributers_access_to_issues_v2.patch (3.28 KB) allow_watchers_and_contributers_access_to_issues_v2.patch patch for 3.2.0.devel.15058 Go MAEDA, 2016-02-04 14:30
allow_watchers_and_contributers_access_to_issues_trunk_r15287.patch (7.4 KB) allow_watchers_and_contributers_access_to_issues_trunk_r15287.patch Takenori TAKAKI, 2016-03-29 04:13
allow_watchers_and_contributers_access_to_issues_3.2.0.patch (7.43 KB) allow_watchers_and_contributers_access_to_issues_3.2.0.patch Fabrizio Sebastiani, 2016-04-06 23:26
allow_watchers_and_contributers_access_to_issues_3.3.0.patch (7.41 KB) allow_watchers_and_contributers_access_to_issues_3.3.0.patch for Redmine 3.3.x Tobias Fischer, 2017-08-08 16:23
allow_watchers_and_contributers_access_to_issues_3.4.2.patch (7.47 KB) allow_watchers_and_contributers_access_to_issues_3.4.2.patch for Redmine 3.4.2 (and probably later) Tobias Fischer, 2017-08-08 17:16
allow_watchers_and_contributers_access_to_issues_4.0.0.patch (7.48 KB) allow_watchers_and_contributers_access_to_issues_4.0.0.patch Kicking Alderman, 2019-01-08 14:18
watchers.png (8.29 KB) watchers.png Kicking Alderman, 2019-01-08 14:19
allow_watchers_and_contributers_access_to_issues_4.0.2.patch (7.74 KB) allow_watchers_and_contributers_access_to_issues_4.0.2.patch for redmine 4.0.2 Jacq Jacq, 2019-02-22 16:08
allow_watchers_and_contributers_access_to_issues_4.1.0.patch (7.61 KB) allow_watchers_and_contributers_access_to_issues_4.1.0.patch Jacq Jacq, 2020-02-17 14:23
allow_watchers_and_contributers_access_to_issues_4.1.0.patch (8.35 KB) allow_watchers_and_contributers_access_to_issues_4.1.0.patch Jonathan Griffon, 2020-03-03 09:16
0001-Fix-query-error-where-no-issue_ids-are-watched-or-fo.patch (2.29 KB) 0001-Fix-query-error-where-no-issue_ids-are-watched-or-fo.patch Fix for postgresql empty list error Frederico Camara, 2021-05-10 19:24
allow_watchers_and_contributers_access_to_issues_4.2.2.patch (7.99 KB) allow_watchers_and_contributers_access_to_issues_4.2.2.patch allow_watchers_and_contributers_access_to_issues_4.2.2. Jobin Joseph, 2021-09-26 00:01
0002-modif-watchers.patch (1.14 KB) 0002-modif-watchers.patch Jonathan Griffon, 2021-11-17 16:53

Related issues

Related to Redmine - Patch #23546: Issue visibility "watched by, created by or assigned to" for rolesNew

Actions
Is duplicate of Redmine - Feature #8488: Create an 'Involve' mechanism to private issuesNew

Actions
Actions #1

Updated by Jan Niggemann (redmine.org team member) over 11 years ago

Good idea, thank you for your patch!

Actions #2

Updated by Brett Patterson about 11 years ago

I've sent this patch in as a pull request to the github repo. The patch above should work on the 2.3.x branch. The only difference are line numbers might be off slightly.

https://github.com/redmine/redmine/pull/15

I know github isn't the official way, but I'm still hopeful this will be integrated.

Actions #3

Updated by Brett Patterson almost 11 years ago

callesg tested with 2.4.1-devel and said it works. I'm working on testing it as well.

Actions #4

Updated by Brett Patterson almost 11 years ago

I can confirm the patch works with 2.4.1. I manually did the patching, but the same changes do work.

Actions #5

Updated by Brett Patterson over 10 years ago

Jean-Baptiste Barth closed the pull request on GitHub; however, no note here even though I referenced the ticket on GitHub. The patch is attached to the original ticket. Please consider merging this in with the next release.

Actions #6

Updated by Toshi MARUYAMA over 10 years ago

  • Related to Defect #17071: Adding Watchers UX Is Not Clean added
Actions #7

Updated by Go MAEDA almost 9 years ago

  • Target version set to Candidate for next major release

Wonderful feature. I really want to see this in 3.3 relase.
Updated the patch for Redmine 3.2.0.devel.15058. Works fine for me. All that remains is to add tests.

Actions #8

Updated by Go MAEDA almost 9 years ago

Here is a screenshot.

screenshot (roles/edit)

Actions #9

Updated by Go MAEDA almost 9 years ago

  • Related to Feature #16845: Add permission rule to allow watchers can edit issues added
Actions #10

Updated by Go MAEDA almost 9 years ago

  • Has duplicate Feature #20106: Adding issue watchers to "Issues Visibility" permissions added
Actions #11

Updated by Go MAEDA almost 9 years ago

  • Has duplicate Feature #13828: when users can only see their own issues; give watchers the ability to view issues they watch added
Actions #12

Updated by Hang Xie over 8 years ago

patch to Redmine 3.2.0, work fine!
it's better than the patch of #8488

Actions #13

Updated by Emrah KAVUN over 8 years ago

Go MAEDA wrote:

Updated the patch for Redmine 3.2.0.devel.15058. Works fine for me. All that remains is to add tests.

Are we able to get the updated version somewhere?

Thanks

Actions #14

Updated by Go MAEDA over 8 years ago

Emrah KAVUN wrote:

Go MAEDA wrote:

Updated the patch for Redmine 3.2.0.devel.15058. Works fine for me. All that remains is to add tests.

Are we able to get the updated version somewhere?

Thanks

Sorry, I forgot to attach the file.
Submitting again: allow_watchers_and_contributers_access_to_issues_v2.patch

Actions #15

Updated by Toshi MARUYAMA over 8 years ago

  • Related to Feature #21909: Issues visibility in roles: Issues where user is a watcher added
Actions #16

Updated by Toshi MARUYAMA over 8 years ago

  • Related to deleted (Feature #21909: Issues visibility in roles: Issues where user is a watcher)
Actions #17

Updated by Go MAEDA over 8 years ago

  • Has duplicate Feature #8858: Extend new issue visibility criteria: issues created by or assigned to the user added
Actions #18

Updated by Takenori TAKAKI over 8 years ago

Go MAEDA wrote:

Wonderful feature. I really want to see this in 3.3 relase.
Updated the patch for Redmine 3.2.0.devel.15058. Works fine for me. All that remains is to add tests.

I have updated the patch for below:
  • Compatible with latest trunk (r15287)
  • Added tests

I also really want to see this in 3.3 relase.

Actions #19

Updated by Fernando Hartmann over 8 years ago

Takenori TAKAKI wrote:

I also really want to see this in 3.3 relase.

+1

Actions #20

Updated by Vedat Kamer over 8 years ago

Fernando Hartmann wrote:

Takenori TAKAKI wrote:

I also really want to see this in 3.3 relase.

+1

+1

Actions #21

Updated by Go MAEDA over 8 years ago

  • Target version changed from Candidate for next major release to 3.3.0

Takenori TAKAKI wrote:

I have updated the patch for below:
  • Compatible with latest trunk (r15287)
  • Added tests

Thanks for adding tests!
The patch works fine and passed all tests. I think we can merge this patch. Setting target version to 3.3.0.

Actions #22

Updated by Fabrizio Sebastiani over 8 years ago

I tested right now a patch derived from Takenori TAKAKI's one allow_watchers_and_contributers_access_to_issues_trunk_r15287.patch
but since i have a 2.3.0 stable, I have arranged it and I provide it here as allow_watchers_and_contributers_access_to_issues_3.2.0.patch it have some little differences.

apply it with -p1 to avoid errors:

# cd /my/redmine/root/dir/2.3.0-stable
# ls -d vendor app extra lib bin config README.rdoc 
app  bin  config  extra  lib  README.rdoc  vendor
# patch -p1 < /somewhere/allow_watchers_and_contributers_access_to_issues_3.2.0.patch

I didn't run test functions, sorry.

Thank you for this patch and candidate for next release. We are getting a good experience with redmine as a new tool in company: this functionality is absolutely important for us.

Actions #23

Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Closed
  • Target version deleted (3.3.0)

This is the same as #8488. Using watchers as a way to give access to issues was already discussed, please see #7412#note-13.

Actions #24

Updated by Jean-Philippe Lang over 8 years ago

  • Related to deleted (Feature #16845: Add permission rule to allow watchers can edit issues)
Actions #25

Updated by Jean-Philippe Lang over 8 years ago

  • Has duplicate deleted (Feature #13828: when users can only see their own issues; give watchers the ability to view issues they watch)
Actions #26

Updated by Jean-Philippe Lang over 8 years ago

  • Has duplicate deleted (Feature #20106: Adding issue watchers to "Issues Visibility" permissions)
Actions #27

Updated by Jean-Philippe Lang over 8 years ago

  • Has duplicate deleted (Feature #8858: Extend new issue visibility criteria: issues created by or assigned to the user)
Actions #28

Updated by Jean-Philippe Lang over 8 years ago

  • Related to deleted (Defect #17071: Adding Watchers UX Is Not Clean)
Actions #29

Updated by Jean-Philippe Lang over 8 years ago

  • Related to Feature #8488: Create an 'Involve' mechanism to private issues added
Actions #30

Updated by Jean-Philippe Lang over 8 years ago

  • Related to deleted (Feature #8488: Create an 'Involve' mechanism to private issues)
Actions #31

Updated by Jean-Philippe Lang over 8 years ago

  • Is duplicate of Feature #8488: Create an 'Involve' mechanism to private issues added
Actions #32

Updated by Tobias Fischer over 8 years ago

There's ongoing discussion in #8488.
But for those landing here in this ticket I can confirm allow_watchers_and_contributers_access_to_issues_3.2.0.patch works well for 3.2.3.stable.15464

Actions #33

Updated by Jan from Planio www.plan.io about 8 years ago

  • Related to Patch #23546: Issue visibility "watched by, created by or assigned to" for roles added
Actions #34

Updated by Peter Brogren almost 8 years ago

We agree that this is functionality that should get merged in, as soon as possible. On the subject of confusing, we believe it is very confusing for someone to get the notification as a watcher but then not be able to log in and see the issue. We do use a modified patch of this and frequently use the method of adding someone as a watcher as a way to allow ("invite") someone to see what happens with a certain private (secret!) issue, i.e. get the email notifications AND be able to log in and see the issue. If such person then decides to "unwatch" the issue, it seems OK with everyone that you no longer get the emails AND are no longer able to see the issue. After all you decided to "unwatch" the issue, i.e. you specifically said you don't want to see (watch) it anymore! Please merge at the earliest convenience!

Actions #35

Updated by Tobias Fischer about 7 years ago

The attached patch is an updated version of allow_watchers_and_contributers_access_to_issues_3.2.0.patch which works for 3.3.x
Needs to be run from redmine install root dir.

Actions #36

Updated by Tobias Fischer about 7 years ago

And this patch was made against Redmine 3.4.2 and I can confirm it works.

Actions #37

Updated by Lara R almost 7 years ago

Tobias Fischer wrote:

And this patch was made against Redmine 3.4.2 and I can confirm it works.

And in which directory did you install it? I am unable to install it.
I got this error:

can't find file to patch at input line 4_ Perhaps you used the wrong -p or --strip option? The text leading up to this was:

|*** diff -Naur app/models/issue.rb ----- File to patch: –

Actions #38

Updated by Tobias Fischer almost 7 years ago

I'm not sure, this has been a while.
But visiting my .bash_history file showed me this:

cp 14318-allow_watchers_and_contributers_access_to_issues_3.4.2.patch redmine-3.4/
cd redmine-3.4/
patch -p0 --dry-run < 14318-allow_watchers_and_contributers_access_to_issues_3.4.2.patch
patch -p0 < 14318-allow_watchers_and_contributers_access_to_issues_3.4.2.patch

So looks like I installed it from the redmine root directory and first tried it with a dry-run.

Actions #39

Updated by Lara R over 6 years ago

Tobias Fischer wrote:

I'm not sure, this has been a while.
But visiting my .bash_history file showed me this:

[...]

So looks like I installed it from the redmine root directory and first tried it with a dry-run.

I tried with those commands but still getting the same error.
Any ideas?

Actions #40

Updated by Mitchell Fang over 6 years ago

+1 Thanks! able to use the 3.4.2 patch on 3.4.4.stable.17206

thanks a bunch

imane seddiki R
Are you sure you are at the root redmine directory? that depends on where redmine was installed.

Actions #41

Updated by froot wang over 6 years ago

+1 Thanks! able to use the 3.4.2 patch on 3.4.6

if use bitnami redmine,should cd htdoc then use patch -p0 cmd.

Actions #42

Updated by Ivan Kotelnikov about 6 years ago

Redmine version 3.4.6
patch -p0 did not work
I have added all changes manually
it works!
Thanks!

Actions #43

Updated by Eric Feyzullov about 6 years ago

3.4.2 patch nice work on 3.4.6. thank you so much


root@66300:/var/www/redmine# patch -p0 < allow_watchers_and_contributers_access_to_issues_3.4.2.diff
patching file app/models/issue.rb
Hunk #1 succeeded at 130 (offset -2 lines).
Hunk #2 succeeded at 165 (offset -2 lines).
patching file app/models/role.rb
patching file config/locales/en.yml
patching file test/unit/issue_test.rb

Actions #44

Updated by Kicking Alderman almost 6 years ago

Awesome work!

Testing Redmine 4.0 right now, and this patch is something we could really use.
The patch worked, but with a couple of minor changes.

First, in the issue.rb file user.groups.map(&:id) should be user.groups.pluck(:id).
Second, there are a couple of line number mismatches, but that can be easily fixed using fuzz:

superuser@redmineserver:/srv/git/redmine$ patch -p0 -F3 < allow_watchers_and_contributers_access_to_issues_4.0.0.patch
patching file app/models/issue.rb
Hunk #1 succeeded at 129 (offset -3 lines).
Hunk #2 succeeded at 164 (offset -3 lines).
patching file app/models/role.rb
patching file config/locales/en.yml
Hunk #1 succeeded at 462 with fuzz 3.
Hunk #2 succeeded at 1020 with fuzz 3.
patching file test/unit/issue_test.rb
Actions #46

Updated by SOE Redmine over 5 years ago

Hi!

Do you have any updated information about the patch in 4.0.2? I would like to install it and try.
Is this the right way i can install it?: patch -p0 -F3 < filename?
Can I uninstall this patch if i needed?
Does this patch effect the further redmine upgrade process?
Do you find any bug related to this patch?

Thanks,

Actions #47

Updated by SOE Redmine over 5 years ago

Please add it as plugin!

Actions #48

Updated by Taner Tas about 5 years ago

Can we extend this patch for private projects too?
This patch seems work only on public projects.

Actions #49

Updated by Luciano Fantuzzi about 5 years ago

+1 to Taner request. All our projects structure is private and this patch works but only applies to public projects. Any chance someone can tell how to make it work also for private projects?

Thank you.

Actions #50

Updated by Eric Feyzullov about 5 years ago

working well with manually add on 4.0.4.stable.18380
thank you

Actions #52

Updated by Jonathan Griffon over 4 years ago

Jacq Jacq wrote:

Testing in Redmine 4.1.0, attached line number mismatches.

this one is working for 4.1.0

Actions #53

Updated by Aleksandar Pavic over 4 years ago

This should be part of core functionality...

+1

Actions #54

Updated by Jobin Joseph over 4 years ago

Working on 4.1.1 ?

Actions #55

Updated by Jej Jerome about 4 years ago

I have issue with it on 4.1.1
Users have 403 error on all issues.

They see issue in issue list, but when they click on it, it's forbidden.
My patch didn't applied correctly. I manually add missing lines and it works well in 4.1.1

Actions #56

Updated by Frederico Camara over 3 years ago

Postgres returns an error:

ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near ")" LINE 1: ...es.assigned_to_id IN (10,111) OR issues.id IN ()))) OR (p...

It seems it does not accept the empty list "issues.id IN ()".

I added some code to fix it, here's the patch. To be applied over your patch:

git -am 0001-Fix-query-error-where-no-issue_ids-are-watched-or-fo.patch
Actions #57

Updated by Jobin Joseph about 3 years ago

Here is the patch for Redmine 4.2.2

Apply with the below commands.

cd redmine
patch -p1 < allow_watchers_and_contributers_access_to_issues_4.2.2.patch
Actions #58

Updated by Jonathan Griffon almost 3 years ago

due to Patch #3329 and new Feature #4511, list of users in Add watcher button does not list potential watchers.

Patch need to check if Issues Visibility is defined as "watched by the user" in all user list

It's only for version 4.2.x

I think problem is under app/models/principal.rb with a new class assignable_watchers which is filtering users but I don't understand how.
I'm sure this is this class because of change in app/controlers/watchers_controller.rb in function users_for_new_watcher old versions list users with @project.users and now it's with @project.principals.assignable_watchers

I worked around the problem by resetting the call to the list of all users in watchers_controller.rb but the groups functionality no longer works (see my patch in attached file)

Actions #59

Updated by Rolf Wojtech almost 3 years ago

I can confirm Jonathan's issue with the 4.2.2 patch. I have not tried his workaround yet.

Maybe it is time to migrate away from the somewhat dirty patching towards this plugin:
https://github.com/maxrossello/redmine_extended_watchers
(found in #8488)

Has anyone done this step already and experiences to share here?

Actions #60

Updated by Jonathan Griffon almost 3 years ago

Rolf Wojtech wrote:

I can confirm Jonathan's issue with the 4.2.2 patch. I have not tried his workaround yet.

Maybe it is time to migrate away from the somewhat dirty patching towards this plugin:
https://github.com/maxrossello/redmine_extended_watchers
(found in #8488)

Has anyone done this step already and experiences to share here?

I tried this plugin and it work well

Thank you

Actions #61

Updated by Aleksandar Pavic over 2 years ago

Go MAEDA wrote:

Here is a screenshot.

screenshot (roles/edit)

+1

This ticket should not be closed...

This should be implemented in core.

Actions #62

Updated by Sofie vdm over 1 year ago

Aleksandar Pavic wrote:

This ticket should not be closed...

This should be implemented in core.

+1

Actions #63

Updated by Gal Ito 11 months ago

Hello. Would it be possible to have a fully compatible release for Redmine 5.1.1 please ?

Actions #64

Updated by Rasko R 11 months ago

Hello guys.

Could you add this feature for latest Redmine 5 version please?

Thanks in advance.

Actions #65

Updated by Stefan Mueller 2 days ago

Hello,
I agree with the previous user.
We also need this behavior or plugin.
Would it be possible to integrate this into Redmine?
Is this plugin compatible with 5.x?
Thanks in advance.

Actions

Also available in: Atom PDF