Ubercart compatible module.

This module extends Ubercart product features.

Grant customers access to items like Nodes and CCK fields, Taxonomy, Roles etc. on your site when they purchase specified Ubercart products. Access can be configured to start immediately, after a fixed period from purchase, or on a preset date, and it can be given either for indefinite time, until a preset date or for a limited period based on the feature's settings.

Currently it has nodes and CCK fields handler that uses ACL and Content Access modules.

With future addition of more handler modules, it can grant access to other items (i.e. Taxonomy, Roles).

Module name does not truly reflect that it can control access to other items (I'm open for new name suggestions, see #1951266: Module needs a better more descriptive name).

Features

  • Extensible with new access handlers. Node & CCK Fields handler is included.
  • Each product can have many access items (added as product features), each item can have its own access handler. This allows for example, to create a product that gives access to a field on a node AND taxonomy access to a set of nodes AND a new role.
  • Each access product feature can have its own schedule - when to grant access, and when to expire the access.
  • User account view gets a new tab - "Premium Content", which lists all items that are granted or will be granted.
  • Nodes get a new section on "Access Control" tab (visible to admins only) that lists all users that have access or will have access.

Requirements

Ubercart (Store, Order, Product, Conditional Actions) for main module
ACL, Content Access for node & CCK field access handler module.

Usage

  • Install the module - copy to your sites/all/modules directory, enable "UC CCK Access" module and "UC CCK Access ACL" handler module on admin/build/modules page.
  • Configure few defaults on the admin/store/settings/products/edit/features page (under "CCK access settings" section).
  • Create product features for existing products or when creating new products (on products/***/edit/features page) - select "CCK access" and click add.
  • Configure the feature - select access handler, settings provided by the handler, and access schedule

Making It Work

(Please see README.txt for a more complete step-by-step configuration)
There are few things that are not self-evident - access to nodes and fields can be very complicated to figure out. Many modules cooperate with (or butt against) each other. If one module gives access, another module cannot take it back. Here are few tips:

To sell access for a specific node

Usually access is given to the whole node with all fields in it.

  1. Create node type, field types and create a node with some content
  2. Remove access to the node you want to be accessible only after purchase in all other access modules (like Content Access).
  3. Test that nobody can view that node but admin or other supervisor roles
  4. Then create a "CCK access" product feature and enter that node (leave all fields unchecked).

To sell access for a specific field on a given node

An example can be a node with two filefield fields - one is a video preview, another is a full video. The node and video preview is accessible to everyone using content_access module. A product feature then gives access only to the filefield with a full video to ones who purchased the product. Follow these steps:

  1. Create node type, field types and create a node with some content
  2. Give access to the node itself to everyone so they can view other fields on the node
  3. Test that everybody can view that node and all fields
  4. Then create a "CCK access" product feature and enter that node, check all fields that it should give access to (leave other fields unchecked).
  5. Test that everybody can view that node and all fields except the fields you checked in the product feature above.

Background

This module is a complete redesign and rewrite of uc_node_access with a lot of additional features. A lot of issues with uc_node_access were fixed in the new architecture. Clean separation of functionality between this module and access handler modules was performed, with API between them that opens possibility for other extensions.

Other

I am not planning to develop any new access handlers at this time, but I will give priority to patch reviews and co-maintainers that are willing to contribute are welcome.

Project information

Releases