Selling Content with Drupal Commerce using Content Access and Roles

In this screencast we'll use Drupal's built-in access control mechanisms (using the Content Access module) to grant access to premium content to users who have a "premium" role.

Here's the recipe:

  • Enable Content Access and the ACL (optional) module.
  • Create a role called "premium"
  • Create a content type called "Premium Content" and put some great content in it.
  • Verify that users can only access the premium content if they have the premium role.
  • Create a product representing the premium role.
  • Create a rule that grants the premium role on order completion:
    • After updating an order
    • If the order state is Completed
    • And the order contains our premium product
    • Add a role to the user who is the owner of the order

That's really all there is to it.

Posted December 16, 2011

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture.
Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.