このルールを強制することはできません...誰でもこのアクションを実行できます。
これが私のルールです
role :student do
has_permission_on :relationships do
to :index
if_attribute :student_id=> is {user.student.id}
end
end
これが私のコントローラーのアクションです
class RelationshipsController < ApplicationController
filter_resource_access :nested_in => :students
def index
@guardians = @student.guardians
end
このルールが正常に機能しているため、正しく設定されていることはわかっています
has_permission_on :students do
to :show
if_attribute :id => is {user.student.id}
end
ルール定義のエラーはどこにありますか?
助けてください