Hello. I am new to Drupal, and am developing a site for a client. It's not a very complex site, but there is a need to restrict access to certain pages on the site only to subscribed users. The majority of the site will be informational and not restricted.

There will be multiple types of subscribers. However, initially there will only be two. This will grow in time, and there could easily be 50-100 subscription types. For now, we'll call them Subscription Type #1 and Subscription Type #2. Subscribed users can have access to just one type, or multiple types. My thought is we should also start with a Subscription Type of All in the event my client decides to offer an all-inclusive subscription at a rate savings.

Subscribed users need to have access to pages with recorded media. If a web user is not a subscriber, they should not be able to view any of the restricted pages. If a web user is a subscriber of only Subscription Type #1, they should be able to view all pages relating to that subscription, but not any pages relating to Subscription Type #2 (or any other future types). If they've been given access to the Subscription Type of All, they should be able to access all of the restricted pages and any others added later.

Just to clarify: The subscribed users will only be viewing the pages and their content. The users won't have any editing permissions.

I've looked at user roles, and creating user roles for users based on each subscription type could work. But, I'm not sure how to grant/restrict access based solely on user roles. And, perhaps there might be an easier way. What would be the simplest, most straight-forward way to accomplish this, and allow for future growth with additional subscription types?

I presently have all pages on the site created with a node type of Basic Page, including the pages to be restricted. I can rebuild those particular pages if needed.

Our current version of Drupal is 7.4, and we're using the Dark Elegant theme. There is 7.42 recommend update available, but that hasn't been installed yet.

Thank you very much in advance for any recommendations!

Comments

Jaypan’s picture

You're better off doing this using modules rather than coding, so you should move this thread to the Post Installation section of the forum.

John Morahan’s picture

GregoryD’s picture

Thank you, John. I'll check out the link and will follow up to let you know how things work. I appreciate your post.

GregoryD’s picture

John,

I went to the link you provided, and took my time reviewing each of the various methods of access control. I think that the Nodeaccess module will probably work best. I was looking for something that would require less work with node types, but I can't see any better way. So, I've installed that module and will begin configuring things. I am having another unrelated issue that is causing me problems, but I'll address that in another thread. I'll leave this thread for now, but will follow up again to let you know what steps were performed once I get my other issue resolved.

Thank you again!

Anonymous’s picture

Have you seen Commerce License covers this sort of functionality, you can license roles, roles == subscription types, roles == permissions:

https://www.drupal.org/project/commerce_license