2013-09-04 3 views

답변

1

내가 발견하지 않는 좋은 방법. 따라서 해결책이있는 작업이 있습니다.

class EntityPropertiesController < ApplicationController 
    before_filter :authenticate_user! 

    def index 
    check_permission 
    end 

    def new 
    check_permission 
    ... 
    end 

    def create 
    check_permission 
    ... 
    end 

    ... 

    protected 

    def check_permission 
    not_found unless (current_user.admin? || current_user.moderator?) 
    end 
end