请求访问私人分类

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 个赞

请看 Category Previews

3 个赞

这个 Plugin 如果自托管可能会起作用

将 url 更改为指向消息群组所有者以请求访问的 url。

否则,一个带有私有类别描述的主题,以及指向消息所有者以请求访问的链接

1 个赞

我已经研究了这两种解决方案,但它们并不是我想要的。

我只想让默认类别页面显示“您无权访问此类别”,并且也许允许我自定义显示的内容,而不是重新创建不存在的类别页面或打开所有主题……

1 个赞

您可能需要考虑在 Marketplace 中发帖,如果您有预算,可以看看能实现哪些功能来满足您的要求。

应该可以更改此文本,但不确定如何操作,但相信大多数默认文本警报都可以编辑。

最好有一个比“哎呀!该页面不存在或已设为私有”的“未找到页面”更专业的页面,尤其是这样没有人会知道该页面是否存在。

默认文本可以更改,但我很确定它使用的是默认的 404 页,在这种情况下编辑它没有意义。

1 个赞

您可以启用 detailed-404 站点设置,我相信它也适用于分类 刚刚检查过,它不适用于分类,只适用于主题,很遗憾:

3 个赞

除了在主页上发布此信息外,目标是否是如果有人点击受限类别中主题的链接,通知会告诉他们如何获得访问权限?不确定现有的详细 404 警报是否适用于此或其工作原理,因此如果不起作用,您可能需要新功能。

您也可以改用其他平台,如 Patreon,如果这是为了订阅者的付费墙,它适用于此并可以与 discourse 集成。

我只是觉得显示 404 错误是不对的。这看起来像是一个损坏的链接或某个地方出了问题。没有任何迹象表明如果他们有不同的访问级别,链接可能会起作用。