Forum Discussion

faster1's avatar
faster1
Contributor
7 months ago

Add anonymous functionality to creating posts or comments

Hi there

We need to add the ability to publish posts and comments as anonymous (optional) for registered users in the community. Can this be implemented using the built-in functionality (since now there use built-in components when creating a post or comment) or do we need to create a custom component for this and use the REST API.

Thanks

8 Replies

  • Can you elaborate what you mean by "anonymous for registered users"? That doesn't make any sense to me... Either a user is registered or not (e.g. anonymous). Khoros can allow posting anonymously, e.g. without logging in or registering, but I would definitely not recommend that as you will get flooded with spam.

    If you mean that regular users that are registered and logged in should be able to post without their "user" attached to what they post: No, that is not easily possible at all and will need major customization, especially if there should really be no way of tracking the user "behind" the anonymous post... e.g. I would not recommend using Khoros for some kind of company internal whistleblower forum or something like that...

  • faster1's avatar
    faster1
    Contributor
    7 months ago

    Hi
    The point is to allow registered users to make posts or comments on posts while being anonymous.
    There is a direct example of this implementation on Facebook.

     

  • Hi faster1 : Since you are referring private group approach in facebook in your screenshots.

     

    As per my knowlegde In Khoros we don't have any option to post any content as anonymous in the community luk  correct me if this statement is not accurate.

     

    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

    Thanks & Regards,
    Abhishek Illindra

  • AbhishekIlindra well, yes, there is the option to post without having to register or log in, but that is not the same as the feature that is requested here. E.g. being registered and logged in but post "as anonymous" (which also in the case of facebook is kinda misleading, the user posting "as anonymous" is hopefully aware that he/she is not anonymous at all, at least not to facebook 😉).

    But in short: No, there is no such feature OOB in Khoros, but it could probably be done through some customization, the question would be how "deep" the fake "anonymity" should go, should it simply be something that is "displayed" in the UI or should it go futher including API requests etc. In the latter case it would get quite tricky as there is simply always a user id associated with any post (the author)...

    If it should really go that deep the only way I could imagine right now would be to basically intercept (or rather [re]direct) the post form in case that checkbox/switch is active and send the data to a custom endpoint which would then post the content on behalf of the user as a global/system wide Anonymous user which you would create separately, e.g. all posts from any registered user that activates this anon-switch would be posted from a single global user which would not really allow any "linking" to the original user once it's done. But that comes of course with a bunch of "issues" you might want to consider:

    - No notifications for the original author
    - No gamification impact (e.g. kudos, metrics etc.) for the original author
    - No editing of the post once it's made
    - Images and attachments are problematic too as they are uploaded before the post is actually sent/saved.
    - You would also have to consider how to exclude that global Anon-user from leaderboards etc. as it would probably skew those as it's collectively getting Kudos/Solutions etc. for all it's "proxied" posts...
    - and probably a bunch more I'm not thinking of right now...

  • Thanks for the detailed explanation luk  on this and I have to admit that I'm afraid that first saying that it may be possible is a bit leeway on assuming that it can be done with an OOTB feature. After your explanation, I came to realize that it is a huge process and it requires a lot of groundwork to be accomplished before it can be accomplished.

     

  • Thanks for your response, luk . Could you please let me know how difficult it would be to implement the functionality to create an anonymous user and allow posts to be published on their behalf? We do not need deep anonymity; simply hiding the author's email and nickname will suffice. Where can I find an example of the default functionality for publishing a post at the endpoint, or does it need to be developed using the API?

  • Hi romanychweb 

     

    I recently attempted something like this. Different use case but I wanted to add some fields to the post page and "redirect" the post page contents as luk suggested. This does require creating a post with the API and comes with all kinds of problems with things like attachments and videos for example. I would go as far as saying this is not possible without Khoros professional services.

  • luk's avatar
    luk
    Boss
    6 months ago
    Could you please let me know how difficult it would be to implement the functionality to create an anonymous user and allow posts to be published on their behalf?

    A "global" Anon user can simply be created via Admin > Users > Create User, that user then has a login, e.g. "Anonymous" or whatever, give it the permission to switch users, then you can use API v1 in the endpoint you'd send the anon post to: https://devdocportal.khoros.com/t5/Community-API-v1-Reference/bd-p/restv1docs?section=commv1&leaf-id=AuthenticationManager.sessions.login#AuthenticationManager.sessions.login to get a session token for that anon user which you post with.

    Then use either API v1 or v2 to create that anon post: https://devdocportal.khoros.com/t5/Community-API-v1-Reference/bd-p/restv1docs?section=commv1&leaf-id=Board.messages.post#Board.messages.post or https://developer.khoros.com/khoroscommunitydevdocs/reference/create-a-message considering tricky stuff like images and attachments as well... as Akenefick said, that's problematic because those files are uploaded on the post page BEFORE the content is posted and are therefore already linked to the original user (technically) and if you want to be really serious about the anon stuff, those should be re-uploaded to the anon user's account, which can't be done in freemarker...e.g. you can't download a file in FreeMarker...afaik. So you'd have to figure out if you can somehow intercept those uploads and do them to the Anon-account instead, which might also be a problem because depending on where that anon-switch is on the post page, the user might not have activated that yet, so the post page wouldn't even know that it should intercept those uploads until it's already too late, e.g. if the files are uploaded first when creating the post and THEN the user activates the "Post anonymously" switch, it won't work properly... (if it can then even be done 😉)...I'd estimate at least 3-5 days of work (finger in the wind...).

    We do not need deep anonymity; simply hiding the author's email and nickname will suffice.

    Well, noone can see the author's email if they are not an admin anyways, and if just the username/nickname in the frontend/UI should be "Anonymous" instead of the actual username, that would certainly be much easier, but as I wrote above, anyone remotely familiar with the API could simply find the original author by asking the API for the specific post in question and the API would just spit out the original author's public data... but also with this there would be things to consider: Like activity feeds on the profile page which would also need to be "anonymized" on the UI side and probably many more places you are not thinking about now that will then accidentally show the real username instead of the Anonymous one...

    Where can I find an example of the default functionality for publishing a post at the endpoint, or does it need to be developed using the API?

    yes that definitely requires custom posting via the API


    Considering all of this and the issues mentioned by Akenefick above, it might even be reasonable to try and completely replace the forum post page with a custom form that always posts to a custom endpoint and creates posts via the API...but that's a whole other rabbit hole to go down!