Refactor policy class lookup
What does this MR do?
Currently the lookup may check whether a class respond to declarative_policy_class
multiple times, which can be avoided.
Since declarative_policy_class
is a very specific method, I think it is safe to assume whoever take use of this will define the correct class name, therefore we don't have to rescue error when calling constantize
.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Kamil Trzciński