HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to allow users to close their own Discussion?

poinspoins New
edited September 2017 in General Banter

How to let users close their own discussions? Thanks for the help in advance.


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    It would require a plugin. Nothing too complicated, though I wouldn't call it the best task for a total beginner.

    The plugin basically would have to duplicate DiscussionControllers close() method, with a few exceptions concerning the permission checks:
    a) Check if session user = discussion author. Exit if not.
    b) Check if session user has Vanilla.Discussions.Close permissions and exit if yes (user is already allowed to close discussions)
    c) Skip the later check for Vanilla.Discussions.Close and maybe replace it with a custom permission

    Additionally, the "Close" option must be added for discussion authors.

    1. I have answered that question because I think it was an interesting question.
    2. I will not write that plugin for you.
    3. I don't have trust in you doing that by yourself, so I will not give you much support beyond what I've said above.
    4. Don't even think of machine-gun-mentioning me, aarong.
  • Options

    @R_J , can you please assist me with some code for this?

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Start, show me what you did and I will give feedback.

  • Options

    @R_J , can you tell me what functions to use?

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP


    Do NOT mention RJ again (or me, or anyone else), unless you have done what you were asked, and made a start on this plugin, so you can explain where you have got to and where you are stuck.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Don't you see this yourself, little guy? You are proving once again that you are not willing to do anything on your own. What motivation should drive me to help you? I'm a supporter, not a servant.

    Go and start! What to do can be taken from the docs and from my answer to your initial question. Unless you don't show any initiative on your own here, I will simply close this discussion because it would become pointless.

Sign In or Register to comment.