Project

General

Profile

Actions

Feature #3088

open

Estimated hours field able to hide role based

Feature #3088: Estimated hours field able to hide role based

Added by Tim Klein over 17 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Permissions and roles
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 5 (1 open — 4 closed)

Related to Redmine - Feature #3976: Hide custom fields from certain rolesClosedActions
Related to Redmine - Feature #12005: Mightful workflow field enhancement: hideNewActions
Has duplicate Redmine - Feature #3781: Add permission to control viewing of Estimated Hours based on RoleClosedActions
Has duplicate Redmine - Feature #15107: Add a permission option to view estimated hoursClosedActions
Has duplicate Redmine - Feature #11963: Hide the estimated times on issues for certain rolesClosedActions

Updated by Eric Davis over 17 years ago Actions #1

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

Updated by Tim Klein over 17 years ago Actions #2

any news?

Updated by Eric Davis about 16 years ago Actions #3

  • Assignee deleted (Eric Davis)

Updated by Anton Nepomnyaschih over 15 years ago Actions #4

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

Updated by Marc Lindsay over 15 years ago Actions #5

+1 on this one!

Updated by Nilson Uehara about 15 years ago Actions #6

+1

Updated by Terence Mill about 15 years ago Actions #7

is covered by #8050

Updated by Pavel Bahushevich almost 14 years ago Actions #9

does anybody have version 1.0.0 of this plugin?

Updated by Jean-Philippe Lang almost 14 years ago Actions #10

  • Status changed from 7 to New

Assigned issue with no assignee back to New status.

Updated by Go MAEDA almost 8 years ago Actions #11

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

Updated by Go MAEDA almost 8 years ago Actions #12

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

Updated by Marius BĂLTEANU almost 8 years ago Actions #13

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

Updated by Go MAEDA almost 8 years ago Actions #14

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

Updated by Bernhard Rohloff almost 8 years ago Actions #15

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

Updated by Thierry Brochu over 7 years ago Actions #16

+1

Updated by Yuichi HARADA over 7 years ago Actions #17

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.

Updated by Go MAEDA about 7 years ago Actions #18

  • Target version set to Candidate for next major release

Updated by Go MAEDA almost 7 years ago Actions #19

Now the patch cannot be applied cleanly.

Updated by Yuichi HARADA almost 7 years ago Actions #20

Go MAEDA wrote:

Now the patch cannot be applied cleanly.

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

Updated by Go MAEDA over 6 years ago Actions #21

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.

Updated by Go MAEDA over 4 years ago Actions #22

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

Updated by Go MAEDA over 4 years ago Actions #23

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

Updated by Victor C over 4 years ago Actions #24

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!

Updated by Go MAEDA over 4 years ago Actions #26

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.

Updated by Yuichi HARADA over 4 years ago Actions #27

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

Updated by Martin Mayr-gebhard about 4 years ago Actions #28

+1

Updated by Mischa The Evil about 3 years ago Actions #29

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

Updated by Stefaan Ellebaut about 2 years ago Actions #30

Any news on when this actually will get into a release?

Actions

Also available in: PDF Atom