Asking for access to a private category

I have a private category on my Discourse site. By “private”, I mean only members of certain groups have access to the category. My boss wants the private category displayed to all users so that they can “yearn” (his word) to have access to it. Since the category won’t show up for people who are not in the special groups, I created a link to the category using the Admin Stylesheet and Header functions.

When “everyone” people click on the link to the private category, they see the 404 page that says “The page you requested doesn’t exist or is private.”

I would like “everyone” to be able to request an upgrade to their group membership via an easy-to-find link on that page. Can I add a link, or at least text, guiding them to send a Mod a private message? Or is there a more elegant solution?

7 лайков

I don’t think there’s any way to do this now, so I changed it to the “feature” category.

This would be a nice competition to features included with tools like Google Groups, private email lists, etc.:

  • Option whether or not to list existence of private group/category publicly
  • Option whether or not to allow users to request to be added
3 лайка

Out of curiousity, what page do you get if you click
https://meta.discourse.org/category/lounge

How does it make you feel, do you yearn or resent?

[quote=“Mittineague, post:3, topic:21135”]
Out of curiousity, what page do you get if you click
https://meta.discourse.org/category/lounge%5B/quote%5D
Here’s a screenshot:

I would say it depends on the context. In this case, it looks like something’s broken; I move on.

In the case I describe, we just want people to know the other category exists and that they can ask to have access.

1 лайк

I’ve put together a plugin to address this. It’s not pretty but it does the job for the time being. Comments and PRs are super-welcome.

https://github.com/rilla/discourse-show-private-categories

5 лайков

I don’t think the lounge should be a “requestable” private category, as it is tied to Trust Level, and its security cannot be modified. To grant someone access to the Lounge, you would need to make them TL3. Besides, the lounge does not have read permissions for anyone else, so either you see it and have full access, or you don’t see it at all. Also, there is no permission to show categories in category view, but not have permission to click through to them - does your plugin create this “view”?

Ok, I understand your concerns perfectly. The plugin is still super green, but also the README can be misleading. In my production instance we don’t use the Staff or Lounge, or any other category with automatically managed permissions, so the technique (i.e. ugly hack) I’m using to show read-limited categories in the list doesn’t care about discriminating ones from the others.

So, yes: the Staff and Lounge categories will be shown and the plugin will pointlessly allow the user to request access to it. I intend to improve this in the future and I encourage you to open an issue in the repo so I don’t forget :wink:

Regarding your other question, the categories are shown but the link is removed, so you can’t click through to the topic list view for that category.

So nope: I’m not providing any new view. Instead of that, the plugin render a box encouraging the user to request access. This button just launches the private message composer pre-filled with some placeholder text.

Hope that makes sense. Thanks for your comments!

4 лайка

I would like something like this, but with the ability to customize the text. For some private categories in my system, users can’t request access at all – but I’d like them to be visible.

3 лайка

Did you find a solution for this @alehandrof?

Nope. We plan to list the groups on our site so that there’s a definitive list somewhere.

Я хотел бы иметь возможность ссылаться на свои закрытые категории, чтобы люди видели сообщение о том, как вступить в категорию, а не странное сообщение об ошибке!

2 лайка

Посмотрите на

3 лайка

Этот #плагин может работать при самостоятельной установке

Измените URL на URL для владельца(ов) группы сообщений, запрашивающего доступ.

В противном случае создайте тему с описанием приватной категории и ссылкой на владельцев сообщений, запрашивающих доступ.

1 лайк

Я изучил оба этих решения, и они не совсем то, что мне нужно.

Мне просто нужно, чтобы на странице категории по умолчанию было написано что-то вроде «У вас нет доступа к этой категории», и, возможно, я мог бы настроить этот текст. Мне не нужно воссоздавать несуществующие страницы категорий или открывать все темы…

1 лайк

Возможно, вам стоит разместить пост в Marketplace, если у вас есть бюджет, чтобы узнать, что можно сделать для выполнения ваших требований.

Должна быть возможность изменить этот текст. Не уверен, как именно это сделать, но, полагаю, почти все стандартные текстовые уведомления можно редактировать.

Было бы хорошо иметь что-то более профессиональное, чем страница «Ой! Страница не найдена или является приватной», особенно потому что в текущем виде никто не поймёт, существует ли страница или нет.

Текст по умолчанию можно изменить, но я почти уверен, что используется стандартная страница 404, редактирование которой в данном контексте не имеет смысла.

1 лайк

Вы можете включить настройку сайта detailed-404. Кажется, она также применяется к категориям — только что проверил, к сожалению, она не применяется к категориям, только к темам:

3 лайка

Помимо публикации этого на главной странице, заключается ли цель в том, чтобы, если кто-то перейдет по ссылке на тему в ограниченной категории, уведомление сообщало им, как получить к ней доступ? Не уверен, сработает ли для этого существующее подробное предупреждение 404 или как оно работает, поэтому, если это не сработает, вам может потребоваться новая функция.

Вы также можете использовать другую платформу, например Patreon, если это нужно для платного доступа для подписчиков — это работает и может быть интегрировано с Discourse.

Я просто считаю, что ошибка 404 — это не то, что нужно показывать. Это выглядит так, будто ссылка битая или где-то возникла проблема. Нет никаких указаний на то, что ссылка может сработать, если у пользователя будут другие уровни доступа.