Posted by seanberto on December 7, 2009 at 11:45pm
Gosh, this seems like it should be an easy one, I'm surprised that I haven't had to do it before....
Any thoughts on how to set up a paid-membership site that allows unauthenticated users to search all content on the site, but then not have access to read the full-page view of that content w/o having a specific user role?
Out of the box, to allow a user to find content via the search they need access to view the content type, right? So, I could create a new permission in a custom module, or "cheat" and just check for a specific role before displaying the content in a full page view.
Thoughts? Is there a contrib module that I don't know about that does this already?
Thanks,
Sean

Comments
Drupal core search doesn't filter results by access
Unless that has changed recently and I missed it. I always thought of that as a glaring security problem, but it would work well in your case ;)
Lev Tsypin
ThinkShout, Inc.
thinkshout.com | twitter.com/levelos
Unless I'm missing something,
Unless I'm missing something, Drupal's node access system has been respected in by node search for some time, at least in 5 and 6.
I'd recommend checking out something like Premium module as it can allow access to teaser only, but prevent viewing a full node without a specific permission (or prevent viewing the node, without restricting search results). I've worked on a couple of patches for it, and it's generally somewhat unloved, but I know there are other similar modules out there.
Yep, you're right. It was a
Yep, you're right. It was a problem in early versions of 5.x but obviously fixed now. I came across this recently, http://drupal.org/project/search_restrict, which had a recent release date, so thought maybe it was still an issue.
Lev Tsypin
ThinkShout, Inc.
thinkshout.com | twitter.com/levelos
Nice. I'll check out that
Nice. I'll check out that Premium module. I'm particularly interested in the possibility of pulling some modules/configurations together to develop an Ubercart Paid-Membership Site distro or feature.
-s