lib/social_stream/ability/base.rb in social_stream-base-0.16.4 vs lib/social_stream/ability/base.rb in social_stream-base-0.17.0
- old
+ new
@@ -20,14 +20,14 @@
can :read, klass do |k| # can :read, Post do |post|
k.post_activity.allow?(subject, 'read')
end
can :update, klass do |k| # can :update, Post do |post|
- k.post_activity.allow?(subject, 'update')
+ [k.channel.author_id, k.channel.owner_id].include?(Actor.normalize_id(subject))
end
can :destroy, klass do |k| # can :destroy, Post do |post|
- k.post_activity.allow?(subject, 'destroy')
+ [k.channel.author_id, k.channel.owner_id].include?(Actor.normalize_id(subject))
end
end
can :create, Comment do |c|
c._activity_parent.allow?(subject, 'read')