tulp/access_schema — Issue #4: How to use plans and acl in a simple way?
Author: gumayunov
Created: 2012-02-27 21:54:19+00:00
State: open
Labels: question

This is boring:

```ruby
#./app/services/review_service.rb

# Serivces can't use any current_user, so we have to
# pass some more options.

class ReviewService < BaseSevice

def mark_featured(review_id, options)

review = Review.find(review_id)

ServiceLocator.acl.require! review, :mark_featured, {
:role => options[:actor].roles,
}

ServiceLocator.plans.require! review, :mark_featured, {
:plan => options[:actor].plan
}

review.featured = true
review.save!

end

end
```