Project

General

Profile

Actions

Feature #3088

open

Estimated hours field able to hide role based

Added by Tim Klein almost 15 years ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Permissions and roles
Start date:
2009-04-01
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

adding the option to hide this field to the "roles and permissions" manager


Files

add_permission_view_estimated_hours.png (50.4 KB) add_permission_view_estimated_hours.png Yuichi HARADA, 2019-04-26 08:08
3088.patch (24.7 KB) 3088.patch Yuichi HARADA, 2019-04-26 08:10
3088-v2.patch (23.6 KB) 3088-v2.patch Yuichi HARADA, 2020-01-30 02:44
3088-v2_5.0.2.patch (25 KB) 3088-v2_5.0.2.patch Victor C, 2022-07-20 13:10
3088-v3.diff (23.5 KB) 3088-v3.diff Go MAEDA, 2022-07-31 14:31
3088-v4.patch (25.4 KB) 3088-v4.patch Yuichi HARADA, 2022-08-01 06:40

Related issues

Related to Redmine - Feature #3976: Hide custom fields from certain rolesClosed2009-10-06

Actions
Related to Redmine - Feature #12005: Mightful workflow field enhancement: hideNew

Actions
Has duplicate Redmine - Feature #3781: Add permission to control viewing of Estimated Hours based on RoleClosed2009-08-25

Actions
Has duplicate Redmine - Feature #15107: Add a permission option to view estimated hoursClosed

Actions
Has duplicate Redmine - Feature #11963: Hide the estimated times on issues for certain rolesClosed

Actions
Actions #1

Updated by Eric Davis almost 15 years ago

  • Status changed from New to 7
  • Assignee set to Eric Davis
  • Estimated time deleted (0.50 h)

I've got something like this hacked onto my site right now that I can extract and cleanup a bit.

Actions #2

Updated by Tim Klein almost 15 years ago

any news?

Actions #3

Updated by Eric Davis over 13 years ago

  • Assignee deleted (Eric Davis)
Actions #4

Updated by Anton Nepomnyaschih almost 13 years ago

+1 It would be very good to get this, as we have to hide our estimations from some roles :(

Actions #5

Updated by Marc Lindsay over 12 years ago

+1 on this one!

Actions #6

Updated by Nilson Uehara over 12 years ago

+1

Actions #7

Updated by Terence Mill over 12 years ago

is covered by #8050

Actions #9

Updated by Pavel Bahushevich about 11 years ago

does anybody have version 1.0.0 of this plugin?

Actions #10

Updated by Jean-Philippe Lang about 11 years ago

  • Status changed from 7 to New

Assigned issue with no assignee back to New status.

Actions #11

Updated by Go MAEDA about 5 years ago

  • Has duplicate Feature #3781: Add permission to control viewing of Estimated Hours based on Role added
Actions #12

Updated by Go MAEDA about 5 years ago

  • Has duplicate Feature #15107: Add a permission option to view estimated hours added
Actions #13

Updated by Marius BÄ‚LTEANU about 5 years ago

  • Related to Feature #12005: Mightful workflow field enhancement: hide added
Actions #14

Updated by Go MAEDA about 5 years ago

  • Has duplicate Feature #11963: Hide the estimated times on issues for certain roles added
Actions #15

Updated by Bernhard Rohloff about 5 years ago

+1 It would be great to have estimated times integrated in the allover times permissions system.

Actions #16

Updated by Thierry Brochu almost 5 years ago

+1

Actions #17

Updated by Yuichi HARADA almost 5 years ago

Add "View estimated hours" permission to the "Roles and permissions".

If the project has the "Time tracking" module enabled and the role has "View estimated time" permission enabled, the "Estimated hours" field is available.
I attached a patch.

Actions #18

Updated by Go MAEDA over 4 years ago

  • Target version set to Candidate for next major release
Actions #19

Updated by Go MAEDA about 4 years ago

Now the patch cannot be applied cleanly.

Actions #20

Updated by Yuichi HARADA about 4 years ago

Go MAEDA wrote:

Now the patch cannot be applied cleanly.

Fixed the patch to work on the current trunk(r19478).

Actions #21

Updated by Go MAEDA almost 4 years ago

Yuichi HARADA wrote:

Fixed the patch to work on the current trunk(r19478).

Thank you for the patch. But I am hesitant to make this patch a candidate for 4.2.0. This is because existing users who can currently see estimated hours will lose access to it after applying the patch because view_estimated_hours will not be granted to no roles by default.

Actions #22

Updated by Go MAEDA almost 2 years ago

Go MAEDA wrote:

Yuichi HARADA wrote:

Fixed the patch to work on the current trunk(r19478).

Thank you for the patch. But I am hesitant to make this patch a candidate for 4.2.0. This is because existing users who can currently see estimated hours will lose access to it after applying the patch because view_estimated_hours will not be granted to no roles by default.

Adding a migration like the following will resolve the above problem.

diff --git a/db/migrate/20220315101502_add_view_estimated_hours_to_all_existing_roles.rb b/db/migrate/20220315101502_add_view_estimated_hours_to_all_existing_roles.rb
new file mode 100644
index 000000000..ed2ad47de
--- /dev/null
+++ b/db/migrate/20220315101502_add_view_estimated_hours_to_all_existing_roles.rb
@@ -0,0 +1,9 @@
+class AddViewEstimatedHoursToAllExistingRoles < ActiveRecord::Migration[6.1]
+  def up
+    Role.all.each { |role| role.add_permission! :view_estimated_hours }
+  end
+
+  def down
+    # nothing to revert
+  end
+end
Actions #23

Updated by Go MAEDA over 1 year ago

  • Target version changed from Candidate for next major release to 5.1.0
Actions #24

Updated by Victor C over 1 year ago

Hi,
I've ported the patch to version 5.0.2, in case there is someone who needs it.

github.com/dotruby/redmine/pull/1

Thanks Yuichi HARADA for the patch!

Actions #26

Updated by Go MAEDA over 1 year ago

The patch still needs to be added some code. Even after revoking the privilege from a user, the update history of the estimated hours field is exposed via issue journal.

Actions #27

Updated by Yuichi HARADA over 1 year ago

Go MAEDA wrote:

The patch still needs to be added some code. Even after revoking the privilege from a user, the update history of the estimated hours field is exposed via issue journal.

It will be improved in the following patch.

diff --git a/app/models/journal.rb b/app/models/journal.rb
index 919a07dd2e..16a9699be4 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -111,6 +111,8 @@ class Journal < ActiveRecord::Base
         detail.custom_field && detail.custom_field.visible_by?(project, user)
       elsif detail.property == 'relation'
         Issue.find_by_id(detail.value || detail.old_value).try(:visible?, user)
+      elsif detail.property == 'attr' && detail.prop_key == 'estimated_hours'
+        user.allowed_to?(:view_estimated_hours, project)
       else
         true
       end
Actions #28

Updated by Martin Mayr-gebhard over 1 year ago

+1

Actions #29

Updated by Mischa The Evil 4 months ago

  • Target version changed from 5.1.0 to Candidate for next major release
While I understand the rationale behind this issue, I'd oppose to the solution proposed in the provided patches. The implementation seems problematic for several reasons, of which some are:
  • this solution only covers the visibility of one specific issue attribute, while there already is a need for a more general solution covering more/other/all attributes;
  • this solution mixes :time_tracking module permissions for :issue_tracking object attribute visibility;
  • this solution seems to make the activation of the :time_tracking module mandatory to be able to see the estimated time in issues, making it impossible to just use the :issue_tracking module.

Given the above and the current status of 5.1.0, I'd say it's best to postpone this issue to a later version for now.

Actions

Also available in: Atom PDF