Added roles_to and rights_to method to controllers
This commit is contained in:
parent
82d72a851c
commit
c7b6b45810
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue