spec/cancan-permits/fixtures/permits/guest_permit.rb in cancan-permits-0.1.0 vs spec/cancan-permits/fixtures/permits/guest_permit.rb in cancan-permits-0.1.1
- old
+ new
@@ -1,25 +1,24 @@
-module RolePermit
- class Guest < Base
- def initialize(ability)
- super
- end
-
- def permit?(user, request=nil)
- super
- return if !role_match? user
-
- can :read, [Comment, Post]
- can [:update, :destroy], [Comment]
- can :create, Article
-
- # owns(user, Comment)
-
- # a user can manage comments he/she created
- # can :manage, Comment do |comment|
- # comment.try(:user) == user
- # end
-
- # can :create, Comment
- end
+class GuestPermit < Permit::Base
+ def initialize(ability)
+ super
end
-end
\ No newline at end of file
+
+ def permit?(user, request=nil)
+ super
+ return if !role_match? user
+
+ can :read, [Comment, Post]
+ can [:update, :destroy], [Comment]
+ can :create, Article
+
+ licenses :user_admin, :blogging
+ # owns(user, Comment)
+
+ # a user can manage comments he/she created
+ # can :manage, Comment do |comment|
+ # comment.try(:user) == user
+ # end
+
+ # can :create, Comment
+ end
+end