you can do bit better by using CanCan and `load_and_authorize_resource` method:

```ruby
class Backoffice::PropositionsController < Backoffice::BackofficeController
  load_and_authorize_resource :election
  before_filter :load_candidacy
  load_and_authorize_resource through: :candidacy

  # actions here

  protected
  def load_candidacy
    @candidacy = @election.candidacies.find_by(candidate_ids: current_candidate.id)
  end
end
```

Look at https://github.com/ryanb/cancan/wiki/Authorizing-controller-actions for more informations