By mrwhizkid on
I have ONE content type (out of about 25) that I need to restrict to authenticated users. I looked at content access but it seems like overkill for one content type.
Is there anyway to code this restriction without having to install a module? Thanks in advance.
Comments
That is where modules come in
That is where modules come in to play and content access will allow you to control access to a single type.
I'm not going to be able to
I'm not going to be able to provide you with sample code, but there is a non-module approach you can take.
You can write some php in your node template that checks the current user's role and if they don't meet the role you've defined, you can server them a different page or different content.
I've used this approach when I want the user to be able to see a small amount of stuff on the page, but not all of it.
That is of course, assuming you can write some basic php. If you can't, you should just install a module.
suscribe too
i would to do the same , how can i do that in php in node-custom.tpl ?
because content access is too much for my need
Dev Server Shared Hosting
8 websites powered by drupal 6,8 & 9 - Hosted by Always Data
Since content access can only
Since content access can only be enable per content type (or per node) it will work fine. Controlling access in a tpl file is really the wrong way to go.
ok it will be just to know,
ok it will be just to know, i'm using Node Privacy By Role (node_privacy_byrole) and it is good for my need
Dev Server Shared Hosting
8 websites powered by drupal 6,8 & 9 - Hosted by Always Data