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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
use OpenProject::Token.lowest_plan_for directly
Ivan Kuchin7f90670bafac
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rbindex 4b371f1f282..809cbc579ab 100644--- a/app/models/enterprise_token.rb+++ b/app/models/enterprise_token.rb@@ -31,12 +31,6 @@ class EnterpriseToken < ApplicationRecordEXPIRING_SOON_DAYS = 30class << self- def get_feature_plan(feature)- OpenProject::Token::FEATURES_PER_PLAN.find do |_plan, features|- features.include?(feature.to_sym)- end&.first- end-def all_tokensall.sort_by(&:sort_key)enddiff --git a/config/initializers/scimitar.rb b/config/initializers/scimitar.rbindex c1c296cc723..ecfa267b9ad 100644--- a/config/initializers/scimitar.rb+++ b/config/initializers/scimitar.rb@@ -36,7 +36,7 @@ Rails.application.config.to_prepare doScimitar.engine_configuration = Scimitar::EngineConfiguration.new(custom_authenticator: lambda doif !EnterpriseToken.allows_to?(:scim_api)- plan = EnterpriseToken.get_feature_plan(:scim_api)+ plan = OpenProject::Token.lowest_plan_for(:scim_api)error = Scimitar::ErrorResponse.new(status: 403,detail: "This endpoint requires an enterprise subscription of at least #{plan}"