Spirit icon indicating copy to clipboard operation
Spirit copied to clipboard

WIP: For logged

Open urielarg opened this issue 6 years ago • 7 comments

This would allow for topics to be invisible for non logged users. I opened this PR as work in progress so I can get an idea if this is something that you want to see implemented or not. If you think it is I could work in tests, upgrade, etc. The main flaw of the feature as it is now IMO is that the "security" around non logged users to be able to see topics it's a bit useless since there is no control in user's registration.

urielarg avatar May 27 '19 19:05 urielarg

What is the use-case for this? I gather this would allow a moderator to restrict access to some topic. But in what case is that needed?

What I wanted: A way to have "visible only for logged in (authenticated)" feature. Why?: My blog has a topic, people will be respectful with one another but they might not feel safe showing their posts to everyone. What I did: add a new property to topic: "for_logged" (or similar), it gets filtered in the view. I added it as another option to update a topic, maybe still need to add during creation. I'll push it to a fork just in case anyone interested. Once I have all these running I'll get into groups permissions.

This is what you wrote here. But this use-case seems to be covered by the "private forum" setting. A half private/half public forum would require the group permission feature, to restrict access to an entire category rather than individual topics.

nitely avatar May 29 '19 04:05 nitely

What is the use-case for this? I gather this would allow a moderator to restrict access to some topic. But in what case is that needed?

What I wanted: A way to have "visible only for logged in (authenticated)" feature. Why?: My blog has a topic, people will be respectful with one another but they might not feel safe showing their posts to everyone. What I did: add a new property to topic: "for_logged" (or similar), it gets filtered in the view. I added it as another option to update a topic, maybe still need to add during creation. I'll push it to a fork just in case anyone interested. Once I have all these running I'll get into groups permissions.

This is what you wrote here. But this use-case seems to be covered by the "private forum" setting. A half private/half public forum would require the group permission feature, to restrict access to an entire category rather than individual topics.

I didn't know about that setting, I missed it. I see now how categories would be broken, not sure why you think it requires groups. Shouldn't we only filter categories for non-logged to all which have at least one visible topic (for him)? I see why you'd have categories and not topics with permissions.

urielarg avatar May 29 '19 17:05 urielarg

If you were planning on setting every topic in a given category as private, then that use-case is better solved by group permissions. The category would be visible to some group(s) as well as all the topics in it. So, categories only visible to logged-in users would be covered by the group permissions feature (i.e: a user must be logged-in and be in an authorized group).

nitely avatar May 29 '19 19:05 nitely

Makes sense, so do you think it's just better to create the whole groups feature rather than doing this "only-for-logged" small one? I will probably keep using this fork and make another fork for the whole "groups-permissions" (if that's what you think is best)

urielarg avatar Jun 01 '19 22:06 urielarg

On a second thought, I'm not sure groups would replace this. Since it's a small change, I say we add this but for categories instead of topics. How that sounds?

nitely avatar Jun 02 '19 00:06 nitely

I added some comments to the code with changes I would have requested, just in case.

nitely avatar Jun 02 '19 00:06 nitely

On a second thought, I'm not sure groups would replace this. Since it's a small change, I say we add this but for categories instead of topics. How that sounds?

Yeah, that is definitely a better idea.

urielarg avatar Jun 02 '19 00:06 urielarg