Feature #44819
openPer-role visibility of standard fields (time entries, issues)
Description
Problem¶
Redmine is often used with client or subcontractor roles that should see the work, but not every detail of it. Custom fields can already be hidden per role: issue custom fields (#3976), version custom fields (#23997) and spent time custom fields (#31859). Standard fields can't. A role either sees an issue or time entry with all of its standard fields, or doesn't see it at all.
The requests for this are old and keep coming back: estimated time (#3088, open since 2009, with duplicates #3781, #11963, #15107), hiding standard fields in general (#12005), dates and % done (#16095). Plugins fill the gap, but each one hides a field in the views it knows about. The value still shows up in a filter, a sort order, a total, an export or the issue history.
What is internal varies, but the same fields come up again and again:
- time entries: who logged the time, the activity, the comment, and when the entry was created or last changed
- issues: estimated time, start and due date, % done, and the author
Proposal¶
1. Mechanism¶
A "View <field>" permission per field, listed under the field's module in the role form. Fields are registered in one place, so a plugin can register its own fields and get the same handling.
Rules:
- Permissions add up across roles as usual; admins have them all.
- A field the user may edit is always visible: an edit form shows every field it edits, and a record must never be saved with blanked values. For time entries this is the "Edit time logs" permission; for issues, a field that the workflow doesn't make read-only.
- Time entries only: your own entries are always shown in full.
A hidden field must be hidden everywhere its value can be read or inferred:
- Per record: views, CSV/PDF/Atom export, REST API (JSON and XML), notification mails, webhook payloads. A hidden person shows as "team member".
- History: journal details for a hidden field are left out, the same way journal details of invisible custom fields already are.
- Lists: sorting, grouping, filtering, totals and report criteria work in SQL over many records. Where a field is hidden in any project a list covers (the project with its subprojects, or all projects), its columns can't be sorted, grouped or totalled, its filters aren't offered and are ignored in saved queries, and the spent time report doesn't offer it as a criterion. A user filter keeps only
<< me >>. - Aggregates: totals built from a hidden field aren't shown: estimated and remaining time on the version page and project overview, and total estimated time on parent issues.
- Views built on a field: Gantt and calendar need start and due dates; issues whose dates are hidden from the user aren't drawn there.
- Activity stream: events that show a hidden field (time entries with a hidden author, comment or date) are left out.
2. Time entries¶
- View who spent and logged time (
user,author) - View spent time activity
- View spent time comments
- View spent time creation and update date (
created_on,updated_on)
Hours, the spent-on date, the issue and the project stay visible: they are what such a role is for.
3. Issues¶
- View estimated time (incl. total and remaining estimated time) - #3088
- View start and due date - #12005, #16095
- View % done - #16095
- View issue author
The assignee is deliberately not included: it drives notifications and the "assigned to me" filters, and hiding it raises questions this ticket doesn't need to answer.
Upgrade path¶
A migration grants every new permission to every existing role (including Non member and Anonymous), so nothing changes until an admin unticks one. This addresses the concern that stalled #3088: the new permission would otherwise be granted to nobody, and existing users would lose access to estimated time.
Why core and not a plugin¶
We run the time entry part as a plugin; the version described here is in review on our side. To work it has to return nil from TimeEntry readers per viewer and patch TimeEntryQuery columns and filters, Redmine::Helpers::TimeReport, the activity provider condition and ApplicationHelper#authoring. Every new core column or filter (like "Updated" in #44463) is a potential leak until the plugin catches up. Issues are worse: their fields also appear in journals, totals, the roadmap, Gantt and calendar.
In core, each place that offers a field checks one permission, the way custom field visibility already works. This is also the answer to the objections on #3088 (only one attribute, permissions from two modules mixed): one mechanism, every field under its own module.
Our earlier version took a different route (a third "Time logs visibility" value next to all/own). We dropped it: core compares that setting to "all" literally in several places, and it mixes "which records" with "which fields".
Proposed phasing¶
- Mechanism + time entries (ready as a plugin, will be ported with tests)
- Issues, including journal details, aggregates, Gantt and calendar
I'm happy to prepare the patches against trunk if the direction is acceptable.
No data to display