Sha256: d39ef60f55174f2330d311447e0b0a2f79ffc8df9c9a5ceffcf7826edd9edbde
Contents?: true
Size: 985 Bytes
Versions: 22
Compression:
Stored size: 985 Bytes
Contents
module UserAccountPermits class UserRolePermit < CanTango::RolePermit def initialize(ability, options = {}) super end def static_rules cannot :manage, User can :read, Comment can :read, Post can :read, Article author_of(Article, :scope => :account) do |author| author.can :manage end author_of(Post, :scope => :account) do |author| author.can :manage end author_of(Comment, :scope => :account) do |author| author.can :manage end can :manage, user_account.user # # can :manage, :all # scope :account do |account| # account.author_of(Article) do |author| # author.can :manage # author.cannot :delete # end # # account.writer_of(Post).can :manage # end # # scope :user do |user| # user.writer_of(Comment).can :manage # end end end end
Version data entries
22 entries across 22 versions & 1 rubygems