Added roles_to and rights_to method to controllers

This commit is contained in:
George Vinogradov 2011-10-24 14:47:32 +04:00
parent 82d72a851c
commit c7b6b45810
1 changed files with 5 additions and 4 deletions

View File

@ -14,11 +14,12 @@ class ApplicationController::Base
end
end
class << self
def rights_to target
Rights.where :rtype => target.class.to_s
ActiveRecord::Base.rights_to target
end
def roles_to target
ActiveRecord::Base.roles_to target
end
end
end