Groups::ApplicationController should have def method_missing for optimizing before_action :authorize_xxx
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Description
Projects::ApplicationController has the following method.
def method_missing(method_sym, *arguments, &block)
case method_sym.to_s
when /\Aauthorize_(.*)!\z/
authorize_action!($1.to_sym)
when /\Acheck_(.*)_available!\z/
check_project_feature_available!($1.to_sym)
else
super
end
end
This method is convenient for defining policy. We usualy use before_action :authorize_xxx! in each controller. However Groups::ApplicationController doesn't have the same archtecture. We should have it for the consistency.
Proposal
Implement the same mechanizm in Groups::ApplicationController.
Links / references
/cc @godfat
Edited by 🤖 GitLab Bot 🤖