Sha256: 4f2db6ebd78afb652c343e208ae4f212b9efe90d488d018c8cfd93e06944b87f

Contents?: true

Size: 409 Bytes

Versions: 3

Compression:

Stored size: 409 Bytes

Contents

class FamilyGallery::Ability
  include CanCan::Ability

  def initialize(user)
    @user = user

    if @user
      @user.user_roles.each do |user_role|
        __send__(user_role.role)
      end
    end
  end

private

  def administrator
    can :manage, FamilyGallery::Group
    can :manage, FamilyGallery::Picture
    can :manage, FamilyGallery::User
    can :manage, FamilyGallery::UserTagging
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
family_gallery-0.0.3 app/models/family_gallery/ability.rb
family_gallery-0.0.2 app/models/family_gallery/ability.rb
family_gallery-0.0.1 app/models/family_gallery/ability.rb