Feature #5037

Role-based issue custom field visibility

Added by Dario Laera over 7 years ago. Updated over 3 years ago.

Status:ClosedStart date:2010-03-10
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues permissions
Target version:2.4.0
Resolution:Fixed

Description

It would be nice to define some kind of view permission for fields in issues. For example, when you define a new custom field you should define also wich role can view this field.
The implementation of #337 should open the way for implementing this feature too.

2014-07-17 09_13_13-Workflow.png (15.9 KB) Juozapis Juozapauskiksi, 2014-07-17 08:21


Related issues

Related to Redmine - Feature #5011: Limit Visible Issue Fields Based on Permissions Closed 2010-03-08
Related to Redmine - Feature #12005: Mightful workflow field enhancement: hide New
Related to Redmine - Feature #14162: Hidden Fields - Role Based Closed
Related to Redmine - Defect #17096: Issue mails cannot be threaded by some mailers New
Related to Redmine - Patch #23997: Per role visibility settings for project and version cust... New
Duplicated by Redmine - Feature #8162: Issue custom field visibility per workflow Closed 2011-04-15
Duplicated by Redmine - Feature #3976: Hide custom fields from certain roles Closed 2009-10-06

Associated revisions

Revision 12012
Added by Jean-Philippe Lang over 4 years ago

Role-based issue custom field visibility (#5037).

Revision 12041
Added by Jean-Philippe Lang over 4 years ago

Fixed that displaying time entries with custom field column raises an error (#5037).

History

#1 Updated by Jean-Philippe Lang over 7 years ago

  • Subject changed from Role-based field visibility to Role-based custom field visibility

#2 Updated by Gints Murāns over 7 years ago

+1 For role based custom fields. This is important, because there is information we as developers don't want to share with everybody else. For example organization heads are not interested in seeing information about technical aspect of the issue?

#3 Updated by pasquale [:dedalus] over 6 years ago

+1

#4 Updated by Terence Mill over 6 years ago

particial dupe of, covered by #8050

#5 Updated by Panagiotis Korros almost 6 years ago

+1

#6 Updated by Moni Ghaoui about 5 years ago

+1

#7 Updated by Terence Mill almost 5 years ago

related (dupe) of Mightful workflow field enhancement: hide #12005

#8 Updated by Daniel Felix almost 5 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Well I'm closing this, even if #12005 isn't implemented now. But #12005 will resolve exact this request after implementation!
Anyway it's kind of duplicate, even if it was an earlier entry than #12005.

#9 Updated by Ernesto Baschny over 4 years ago

+1 on this, would be a nice improvement, and not overly complex.

#10 Updated by Ernesto Baschny over 4 years ago

Should not be restricted to "custom fields" of course, but to all fields of an issue.

#11 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from Closed to New
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.4.0

#12 Updated by David Robinson over 4 years ago

+1

Being able to "hide" certain fields (including not custom fields) for certain roles would be much appreciated.

Also mail updates, reports (pdf) and feeds should not carry hidden fields for the roles for which they have been hidden.

#13 Updated by VD DV over 4 years ago

++++1 for planning this feature for next version. Great!!!

#14 Updated by Jean-Philippe Lang over 4 years ago

David Robinson wrote:

Being able to "hide" certain fields (including not custom fields) for certain roles would be much appreciated.

Well, this feature planned for 2.4.0 is about custom fields only. Being able to hide some standard fields would be a bit trickier and might be added later, sorry.

#15 Updated by David Robinson over 4 years ago

Jean-Philippe Lang wrote:

David Robinson wrote:

Being able to "hide" certain fields (including not custom fields) for certain roles would be much appreciated.

Well, this feature planned for 2.4.0 is about custom fields only. Being able to hide some standard fields would be a bit trickier and might be added later, sorry.

OK, Should I create a new feature request for it then?

#16 Updated by Jean-Philippe Lang over 4 years ago

David Robinson wrote:

OK, Should I create a new feature request for it then?

Sure, and thanks for the feedback!

#17 Updated by Jean-Philippe Lang over 4 years ago

Here are some details about the possible implementation of custom fields visibility:
  • update the issue custom field form in order to select roles that can see the field
  • update the issue view (HTML, PDF, API) to hide hidden custom fields, including in the issue history (custom fields changes)
  • update the issue form to exclude hidden custom fields
  • completely exclude custom fields from the issue list (columns/filters) if they are not visible by the user on any projects
  • update the issue list (HTML, PDF, CSV, API) to hide hidden custom fields values per row (on the cross-project list, the user might be able to see custom fields for some projects but not for some other projects, depending on his roles on these projects)
  • when filtering or grouping the issue list by a custom field, exclude issues for which the custom is not visible
  • same thing for the time entries list (where issue custom fields can be displayed/filtered)
  • update the search engine so that it doesn't look up in searchable custom fields that are not visible
  • update the email notification system so that each user receives an email with only visible custom field (need to change message-ids since multiple emails might now be sent for the same event)
  • when updating an issue by just changing custom fields values, don't notify users that can't see these custom fields

Please let me know if I'm missing something.

#18 Updated by Ernesto Baschny over 4 years ago

Jean-Philippe: maybe also consider Custom Queries:

  • don't offer the custom fields that are hidden in "custom queries" (queries/new) "Add filter" option
  • hide Custom Queries which include filtering by some custom field which is hidden

I wonder if it isn't worth to also consider the "regular fields" at the same time, because you will have to touch all those different areas anyway. Or at least prepare an API for it, to make it easier to later hide "regular fields" (maybe someone could then write a plugin to do so).

From the regular fields there are some "special ones" which shouldn't be hideable, i.e. "Status", "Tracker", "Parent Task" and "Subject".

#19 Updated by Toshi MARUYAMA over 4 years ago

  • Resolution deleted (Duplicate)

#20 Updated by Александр Александрук over 4 years ago

+1
It will be very useful feature! Look forward to!
Jean-Philippe Lang You're doing a great job, thank you!

#21 Updated by Jean-Philippe Lang over 4 years ago

  • Subject changed from Role-based custom field visibility to Role-based issue custom field visibility
  • Status changed from New to Closed
  • Resolution set to Fixed

Feature added in r12013. You can now limit the visibility issue custom field to certain roles.

Ernesto Baschny wrote:

  • don't offer the custom fields that are hidden in "custom queries" (queries/new) "Add filter" option

Done

  • hide Custom Queries which include filtering by some custom field which is hidden

That would involve too much logic for filtering custom queries. Instead, custom queries can now be made visible to certain roles only (#1019 added for 2.4.0). A user that would be able to display a custom query with fields that are not visible to him wouldn't see them anyway. Queries always take care to show visibile fields only.

#22 Updated by Terence Mill over 4 years ago

This is great Jean! Tx for this.

#23 Updated by Ernesto Baschny over 4 years ago

Thanks Jean!

The correct revision where this was added is r12012.

Still feature #12005 (having the same feature available for standard fields as well) is still very much desired. :)

#24 Updated by Etienne Massip over 4 years ago

  • Status changed from Closed to Reopened

500 when trying to add a spent time custom field to spent time report:

ActionView::Template::Error (undefined method `visible_by?' for #<TimeEntryCustomField:0x3e7bb50>):
    19: <tbody>
    20: <% entries.each do |entry| -%>
    21:   <tr class="time-entry <%= cycle("odd", "even") %> hascontextmenu">
    22:     <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td>
    23:     <%= raw @query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, entry)}</td>"}.join %>
    24:     <td align="center">
    25:     <% if entry.editable_by?(User.current) -%>
  app/models/query.rb:84:in `value'
  app/helpers/queries_helper.rb:84:in `column_content'
  app/views/timelog/_list.html.erb:22:in `block (3 levels) in _app_views_timelog__list_html_erb__1016642981_38612940'
  app/views/timelog/_list.html.erb:22:in `map'
  app/views/timelog/_list.html.erb:22:in `block (2 levels) in _app_views_timelog__list_html_erb__1016642981_38612940'
  app/views/timelog/_list.html.erb:19:in `each'
  app/views/timelog/_list.html.erb:19:in `block in _app_views_timelog__list_html_erb__1016642981_38612940'
  app/views/timelog/_list.html.erb:1:in `_app_views_timelog__list_html_erb__1016642981_38612940'
  app/views/timelog/index.html.erb:20:in `_app_views_timelog_index_html_erb___932575742_45051756'
  app/controllers/timelog_controller.rb:64:in `block (2 levels) in index'
  app/controllers/timelog_controller.rb:51:in `index'

CustomField#visible_by? seems to be implemented in IssueCustomField only, did you mean to implement a default one in CustomField?

#25 Updated by Jean-Philippe Lang over 4 years ago

  • Status changed from Reopened to Closed

Etienne Massip wrote:

CustomField#visible_by? seems to be implemented in IssueCustomField only, did you mean to implement a default one in CustomField?

Thanks for pointing this out, it's fixed in r12041.

#26 Updated by Vimal Joseph over 4 years ago

Thanks for this feature. When can we expect this in a stable release?

#27 Updated by Toshi MARUYAMA over 4 years ago

  • Related to Feature #3976: Hide custom fields from certain roles added

#28 Updated by Toshi MARUYAMA over 4 years ago

  • Related to deleted (Feature #3976: Hide custom fields from certain roles)

#29 Updated by Toshi MARUYAMA over 4 years ago

  • Duplicated by Feature #3976: Hide custom fields from certain roles added

#30 Updated by Sebastian Sp about 4 years ago

Hello, is it possible to add this feature to release 2.3.4, as it would be very very nice for our redmine installations.

Best regards,

Sebastian

#31 Updated by Christoph Klesser about 4 years ago

+1

Sebastian Spill wrote:

Hello, is it possible to add this feature to release 2.3.4, as it would be very very nice for our redmine installations.

Best regards,

Sebastian

#32 Updated by Tobias Fischer about 4 years ago

dude, read the ticket! It's planned for the next version 2.4.0!
2.3.x releases only contain bugfixes and never any new features...

#33 Updated by Sebastian Sp about 4 years ago

Hello,

thanks a lot for quick release! I found a bug regarding this new feature:

When you add custom fields with option "required", the role-based feature does not work correctly. The fields are not displayed, but the validation routine makes the ticket unsaveable.

Regards,

Sebastian

#34 Updated by Jean-Philippe Lang almost 4 years ago

Sebastian Spill wrote:

When you add custom fields with option "required", the role-based feature does not work correctly. The fields are not displayed, but the validation routine makes the ticket unsaveable.

Please, open a bug report.

#35 Updated by Toshi MARUYAMA almost 4 years ago

Jean-Philippe Lang wrote:

Sebastian Spill wrote:

When you add custom fields with option "required", the role-based feature does not work correctly. The fields are not displayed, but the validation routine makes the ticket unsaveable.

Please, open a bug report.

FTR: #15408

#36 Updated by Stefan T. Oertel almost 4 years ago

Hi there,

is there a chance to have the feature also for non-issue related custom fields, like "Spent time"? Would be very useful.

Thanks,
Stefan

#37 Updated by Juozapis Juozapauskiksi over 3 years ago

Hi I cannot see any visibility controls. See attached file.
Sorry looked in wrong place..

#38 Updated by Toshi MARUYAMA over 2 years ago

  • Related to Defect #17096: Issue mails cannot be threaded by some mailers added

#39 Updated by Toshi MARUYAMA about 1 year ago

  • Related to Patch #23997: Per role visibility settings for project and version custom fields added

Also available in: Atom PDF