Hi,
Premium provides a hook_premium_access to enable other modules to grant access to premium content. However, no matter what the implementation of this hook says, the users still have to mark content as Premium using the "Access restricted for non-premium users" checkbox. Other modules can not decide that a content is Premium; they can only grant access to premium content.
I thought it could be nice to make the Premium module an empty shell and ask submodules to decide if a content is premium or not, and decide if user has access to this premium content. So maybe we can split Premium in two modules, Premium and Premium Basic; Premium would be an empty shell, calling submodules like Premium Basic to take the actual decisions. Other submodules could be added (I wrote a Premium Taxonomy submodule).
I am attaching the result of this split; it is not a patch, but the full code. This is based on the 5.x-1.x-dev release.
Let me know what you think.
Patrick
| Comment | File | Size | Author |
|---|---|---|---|
| premium.tar_.gz | 9.04 KB | pfournier |
Comments
Comment #1
moshe weitzman commentedi will likely need this soon since i need to make premium depending on nodereference value
Comment #2
allie mickahttp://drupal.org/node/116983#comment-916086 ?
Comment #3
allie mickaI think you can accomplish what you're looking for through the new features:
I have moved premium_access to the 'load' operation in hook_nodeapi. From there, your module's hook_premium_access will affect the node's premium status regardless of whether or not it's actually premium.
I'm on the fence about the premium_basic stuff, and I'm deferring that part for now. If you'd like to work on this or other functionality, please submit patches instead of tarballs.
Thanks!