Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

418 B
Raw Blame
module TimeEntries
  module TimeEntryScopes
    include ::CostScopes

    def view_allowed_entries_permission
      :view_time_entries
    end

    def view_allowed_own_entries_permission
      :view_own_time_entries
    end

    def with_visible_rates_on(scope, user: User.current)
      table = arel_table
      scope.where(view_or_view_own(table, :view_hourly_rates, :view_own_hourly_rate, user))
    end
  end
end