Skip to content

Commit

Permalink
fix abilities for channel ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
mjtko committed Mar 16, 2013
1 parent e6d30a4 commit 621fdf6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/models/ability.rb
@@ -1,13 +1,13 @@
#
#==============================================================================
# This file is part of Kandan.
# https://github.com/kandanapp/kandan
#
# Kandan's code and assets are dual-licensed. Kandan is available
# generally under the AGPL, and also under a custom license via
# special agreement. See LICENSE for the AGPL terms, and contact us at
# <admin@kandanapp.com> if you're interested in development of Kandan
# under a custom license.
#
# special agreement. See LICENSE for the AGPL terms, and contact us
# at <admin@kandanapp.com> if you're interested in development of
# Kandan under a custom license.
#==============================================================================
class Ability
include CanCan::Ability

Expand All @@ -16,7 +16,10 @@ def initialize(user)
can :manage, :all
else
can [:read, :create], Channel
can :manage, Channel, :user => user
can :manage, User, :id => user.id # can manage themselves
end
can :read, User
# This goes last in order to override all other permissions.
cannot :destroy, Channel, :id => 1
end
Expand Down

0 comments on commit 621fdf6

Please sign in to comment.