Add new APIs for overriding Rule - #764
Open
hoangpn wants to merge 2 commits into
Open
Conversation
hoangpn
force-pushed
the
feature/override_rule_api
branch
3 times, most recently
from
August 13, 2026 09:39
edaae0a to
95b1206
Compare
We have replaced the copy_to() function of the Rule model with a newly created override() function. The new function allows for the creation of a new Rule by copying the original Rule and also overriding its attributes at the time of creation, providing greater flexibility in usage.
We have added a new function to the RuleMixin class. Consequently, new APIs have been generated that allow users to create a new Rule for a Service or Project by overriding an existing Rule. These APIs require the original Rule ID and optionally accept other Rule attributes as the overridden fields. There are constraints for these APIs: - An overridden Service Rule must inherit from a Site Rule. - An overridden Project Rule must inherit from a Site Rule or its parent Service Rule. Although the SiteViewSet also inherits from the RuleMixin class, we disable this API for the SiteViewSet because we cannot create any Site Rules as overridden Rules.
hoangpn
force-pushed
the
feature/override_rule_api
branch
from
August 13, 2026 09:44
95b1206 to
de03875
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.