Feature #3088

Estimated hours field able to hide role based

Added by Tim Klein over 13 years ago. Updated 18 days ago.

Status:NewStart date:2009-04-01
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Permissions and roles
Target version:5.1.0
Resolution:

Description

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

add_permission_view_estimated_hours.png (50.4 KB) Yuichi HARADA, 2019-04-26 08:08

3088.patch Magnifier (24.7 KB) Yuichi HARADA, 2019-04-26 08:10

3088-v2.patch Magnifier (23.6 KB) Yuichi HARADA, 2020-01-30 02:44

3088-v2_5.0.2.patch Magnifier (25 KB) Victor C, 2022-07-20 13:10

3088-v3.diff Magnifier (23.5 KB) Go MAEDA, 2022-07-31 14:31

3088-v4.patch Magnifier (25.4 KB) Yuichi HARADA, 2022-08-01 06:40


Related issues

Related to Redmine - Feature #3976: Hide custom fields from certain roles Closed 2009-10-06
Related to Redmine - Feature #12005: Mightful workflow field enhancement: hide New
Duplicated by Redmine - Feature #3781: Add permission to control viewing of Estimated Hours base... Closed 2009-08-25
Duplicated by Redmine - Feature #15107: Add a permission option to view estimated hours Closed
Duplicated by Redmine - Feature #11963: Hide the estimated times on issues for certain roles Closed

History

#1 Updated by Eric Davis over 13 years ago

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

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

#2 Updated by Tim Klein over 13 years ago

any news?

#3 Updated by Eric Davis about 12 years ago

  • Assignee deleted (Eric Davis)

#4 Updated by Anton Nepomnyaschih over 11 years ago

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

#5 Updated by Marc Lindsay over 11 years ago

+1 on this one!

#6 Updated by Nilson Uehara about 11 years ago

+1

#7 Updated by Terence Mill about 11 years ago

is covered by #8050

#9 Updated by Pavel Bahushevich about 10 years ago

does anybody have version 1.0.0 of this plugin?

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

  • Status changed from 7 to New

Assigned issue with no assignee back to New status.

#11 Updated by Go MAEDA almost 4 years ago

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

#12 Updated by Go MAEDA almost 4 years ago

  • Duplicated by Feature #15107: Add a permission option to view estimated hours added

#13 Updated by Marius BALTEANU almost 4 years ago

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

#14 Updated by Go MAEDA almost 4 years ago

  • Duplicated by Feature #11963: Hide the estimated times on issues for certain roles added

#15 Updated by Bernhard Rohloff almost 4 years ago

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

#16 Updated by Thierry Brochu over 3 years ago

+1

#17 Updated by Yuichi HARADA over 3 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.

#18 Updated by Go MAEDA over 3 years ago

  • Target version set to Candidate for next major release

#19 Updated by Go MAEDA almost 3 years ago

Now the patch cannot be applied cleanly.

#20 Updated by Yuichi HARADA almost 3 years ago

Go MAEDA wrote:

Now the patch cannot be applied cleanly.

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

#21 Updated by Go MAEDA over 2 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.

#22 Updated by Go MAEDA 9 months 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

#23 Updated by Go MAEDA 5 months ago

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

#24 Updated by Victor C 5 months 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!

#25 Updated by Victor C 5 months ago

#26 Updated by Go MAEDA 4 months 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.

#27 Updated by Yuichi HARADA 4 months 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

#28 Updated by Martin Mayr-gebhard 18 days ago

+1

Also available in: Atom PDF