Skip to content

Commit

Permalink
Fix mod permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
pdai1y committed Jul 10, 2015
1 parent b082910 commit 6453441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ def initialize(user)
can :access, :rails_admin # grant access to rails_admin
can :dashboard
elsif user.has_role?(:mod)
can :manage, [ GameSession, Game, GameMode ]
can :read, :all
can :access, :rails_admin # grant access to rails_admin
can :new, [Game, GameMode, GameSession] # included in :create
can :export, [Game, GameMode, GameSession]
can :destroy, [Game, GameMode, GameSession] # for BulkDelete
can :destroy, [Game, GameMode, SiteNews] # for BulkDelete
can [:edit, :create], [Game, GameMode, GameSession, SiteNews]
end
can :read, [ GameSession, Game, User ]
can [:destroy, :edit], GameSession, :creator_id => user.id # manage owned gamesessions
can :edit, GameSession, :creator_id => user.id # manage owned gamesessions
can :create, GameSession # create gamesession
can [:update_games, :sort_by_game, :end_game], GameSession
can :join_game, GameSession # join gamesessions
can :leave_game, GameSession # leave gamesessions
can [:edit, :update, :destroy], User, :id => user.id # manage own profile
can :read, SiteNews
end
end

0 comments on commit 6453441

Please sign in to comment.