Creating a new License Type to purchase individual nodes

Created on 30 January 2018, almost 7 years ago
Updated 6 November 2018, about 6 years ago

I've read through the issue queue and seen a similar feature that i've seen in another issue that I'd like to implement (comment #8 https://www.drupal.org/project/commerce_license/issues/2934928 🐛 Fatal error when attempting to add a license Fixed ) . I'm fairly new to Drupal 8 development so please bare with me.

What I'm looking to do is create a new plugin for a new Licence Type that will grant node access on a per user per node basis. My approach would be the following:

Setup

  1. Create a new content type for purchase
  2. Add a new License Type using a plugin
    • grantLicense/revokeLicense methods will set permissions for the license owner using Node Access Grants or Content Access module (not sure which one yet)
  3. Create a new order item type to use licenses
  4. Create a new product
    • The product will have a inline entity reference form to create a single entity of the new content type
  5. Create a new product variation that uses the new license type.

My questions

Would this be the best approach to do this? I may be going down the wrong path but it seems like it should work.

When trying to implement this, I'm unable to get the new content type entity reference from the License entity reference to the product using rules. I'm thinking i should be able to use this chain to get to the node to set permissions ( license > product_variation > node ). Should I be able to access the Product fields from the product_variation entity referenced by the license?

Any guidance is really appreciated.

💬 Support request
Status

Active

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024