Fix undefined method [] for nil when using Model.require_permission