Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Protected Specific Content (only for specific user)?

Started by maddin 4 years ago · 6 replies · 660 views
4 years ago

I now learned something about the login plugin or the private access plugin. Then a user only see the page and its content after login.

I would like to know, if there is an option to protect content for specific users.

For example: User A is logging into the website. After login he only see the content which is only for him. After logging out he see the default page/login form. User B is logging in and see his specific content.

Please help!

4 years ago

Is this some of a solution of my question?

/forum/general/user-groupe-dependent-content-t7558

Maybe I have to put HTML/Twig Code under the username to display only for the user?

4 years ago

@wmcig:
Is this some of a solution of my question?

It probably is. We don't know from your question yet how you plan to map users to the individualised content. Also, depending on your setup, groups might be a better fit.

4 years ago

@wmcig:
Do you mean that I am creating a group. In this group a user is a member of the group and only users of this group have access to a site/page?

Yes, if that fits what you are trying to do, which I still don't know BTW.

@wmcig:
Is there any way to do this with content parts?

In general, put a condition in Twig just around the content you want to personalise, like the example you cited but by group. However, I am not familiar with exactly the right condition to check, I'm sorry. Looking through the API documentation, I think it has all changed recently. If I needed to do this, I would use trial and error.

Sorry I can't be more specific, perhaps someone else knows.

4 years ago

Okay. Thank you for your answer. Maybe you can contact the person who is more familiar with this API Access Level topic to get into this topic?

4 years ago

@wmcig:
Maybe you can contact the person who is more familiar with this API Access Level topic to get into this topic?

It doesn't work that I'm afraid. The people who know (not sure who) would need to read this and honestly there is some chance they won't.

I suggest either waiting a little longer here or going to the Grav chat channel on Discord where if you are lucky you will get a quick answer.

You can link to this thread so that they know that you have tried here. If you find an answer, please come back here and summarise it, so that there's a record for someone searching in future. There are some helpful and knowledgeable people hanging out there.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 54 12 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 15 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago