Set permission to view an item's existence, but not its content

Post

Posted
Rating:
#3763 (In Topic #739)
Avatar
Standard member
jacobgkau is in the usergroup ‘Well-settled’
Greetings,

My website has a main_news block on the front page, and I've got a news category which consists of private content for a specific usergroup. I've set the category so that guests and members don't have view access, while the proper usergroup does, which works as expected. However, guests and members do not see the entry in the main_news block on the homepage.

I understand that this is expected behavior, as you normally don't want to offer a link to content that someone doesn't have permission to view, but in this case I'd like the restricted links to be visible in order to encourage people to sign up for the usergroup which does have permission. What would be the best way to accomplish this?
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by jacobgkau)
#3764
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

You'd need to alter the code in sources/blocks/main_news.php. Change has_category_access to true || has_category_access at both occurrences.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#3768
Avatar
Standard member
jacobgkau is in the usergroup ‘Well-settled’
Perfect, thank you!
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

Salman, mytracker, Manu, amit.nigam, ManojSree

Forum statistics:
  • 1,298 topics, 5,830 posts, 7,064 members
  • Our newest member is flour2door
Birthdays:
Back to Top