Merge Request #14
← To merge requests
From
comments_permissions
into
master
Commits (1)
-
Please write the tests for this new exposure
-
Please write the tests for this new exposure
-
Added 1 new commit:
- 3f663018 - Added tests for comment removal
-
Added 1 new commit:
- 7379b4c8 - mend
-
Added 1 new commit:
- 2209c9e4 - Exposing permission to delete comment
-
Status changed to closed
started a discussion
on the diff
app/api/entities.rb
169 | 169 | expose :created_at, :format_with => :timestamp |
170 | 170 | expose :author, :using => Profile |
171 | 171 | expose :reply_of, :using => CommentBase |
172 | + expose :permissions do |comment, options| | |
173 | + Entities.permissions_for_entity(comment, options[:current_person], | |
174 | + :allow_destroy?) | |
1 |
|
started a discussion
on the diff
app/models/comment.rb
211 | 211 | user == author || user == profile || user.has_permission?(:moderate_comments, profile) |
212 | 212 | end |
213 | 213 | |
214 | + # method used by the API | |
215 | + alias_method :allow_destroy?, :can_be_destroyed_by? | |
1 |
|