Sha256: 2c4a6c4f50096e7d0de38e554dd553151f5252c13dcdd1eacacd8fc09ae57988

Contents?: true

Size: 683 Bytes

Versions: 10

Compression:

Stored size: 683 Bytes

Contents

# This block uses the DSL defined by CanCan.
# https://github.com/ryanb/cancan/wiki/Defining-Abilities

Houston.config do


  role "Maintainer" do |team|

    # Maintainers can change projects' settings
    can :update, Project, id: team.project_ids

  end


  abilities do |user|
    if user.nil?

      # Guests have no additional abilities

    else

      if user.admin?

        # Admins can see Actions
        can :read, Action

      end

      # All users can see Teams
      can :read, Team

      # All users  can see Projects
      can :read, Project

      # All users can see Users and update themselves
      can :read, User
      can :update, user

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
houston-core-0.9.2 templates/new-instance/config/abilities.rb
houston-core-0.9.1 templates/new-instance/config/abilities.rb
houston-core-0.9.0 templates/new-instance/config/abilities.rb
houston-core-0.9.0.rc1 templates/new-instance/config/abilities.rb
houston-core-0.8.4 templates/new-instance/config/abilities.rb
houston-core-0.8.3 templates/new-instance/config/abilities.rb
houston-core-0.8.2 templates/new-instance/config/abilities.rb
houston-core-0.8.1 templates/new-instance/config/abilities.rb
houston-core-0.8.0 templates/new-instance/config/abilities.rb
houston-core-0.8.0.pre2 templates/new-instance/config/abilities.rb