mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Invert visible logic to admin_only?
This commit is contained in:
@@ -67,7 +67,7 @@ module Projects
|
||||
if user.admin?
|
||||
model.available_custom_fields
|
||||
else
|
||||
model.available_custom_fields.select(&:visible?)
|
||||
model.available_custom_fields.reject(&:admin_only?)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class CustomValue < ApplicationRecord
|
||||
to: :strategy
|
||||
|
||||
delegate :editable?,
|
||||
:visible?,
|
||||
:admin_only?,
|
||||
:required?,
|
||||
:max_length,
|
||||
:min_length,
|
||||
|
||||
@@ -385,7 +385,7 @@ module API
|
||||
custom_fields = if current_user.admin?
|
||||
represented.available_custom_fields
|
||||
else
|
||||
represented.available_custom_fields.select(&:visible?)
|
||||
represented.available_custom_fields.reject(&:admin_only?)
|
||||
end
|
||||
|
||||
custom_field_class(custom_fields)
|
||||
|
||||
@@ -168,7 +168,7 @@ module Redmine
|
||||
end
|
||||
|
||||
def visible_custom_field_values
|
||||
custom_field_values.select(&:visible?)
|
||||
custom_field_values.reject(&:admin_only?)
|
||||
end
|
||||
|
||||
def custom_value_for(c)
|
||||
|
||||
Reference in New Issue
Block a user