Replace "free access" logic with "requires add-on"
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !195765 (merged) should be addressed:
-
@GitLabDuo started a discussion: (+5 comments) The inline implementation of
service_free_access?
duplicates the logic that was previously in thefree_access?
method. This creates code duplication and potential maintenance issues.return denied_response unless service.cut_off_date.nil? || service.cut_off_date&.future?
Consider extracting this logic into a shared module or utility method to avoid duplication across the codebase.
We used to say that a UP/service is in "free access" either when:
- no cut-off date is defined
- this date is in the future
However, this leads to the situation now that by default, everything is in free access unless you define this date, which is unsafe and usually not the case. We should instead base this on the presence of add_ons
instead.