@julian Whaaaaaat??? 😢
I will try to submit a PR. It's probably better to do a breaking change before v1.0.0
I am working on a plugin for my forum, and i need to allow some users to modify the first topic's post. The main idea is create admins for the topics. But im having problems with the privileges.
My plugin hooks filter:privileges.topics.get, and if the actual user given by the uid is admin in the topic, it sets "editable" property to true. But the edit buttons aren't show, and if i show it manually, it says that the user is not authorized to do this..
Is this a bug, or I am doing wrong?
Thank for the help!
Usually, pinging a developer like @julian helps when posts fall through the cracks
For future reference
Looks like this post fell through the cracks indeed. The problem you are trying to solve actually happens to be our oldest issue that is still open: https://github.com/NodeBB/NodeBB/issues/148
Is this open source? Maybe we can have a look. @julian is definitely the person to go to for priv related topics though
EDIT: warning, the GH issue contains outdated information re: privs
My plugin is not open source because i havent finished yet.. And now i have lost my plugin due to some computer problems... I did a super simple prototype where the user can mention other users inside of special tags, like bbcodes. Example:
When a topic is requested, the "filter:privileges.topics.get" hook function of my plugin is called, and it search the "[admins]" tag and, if the user that request the topic is in the admins tag, my plugin set "editable" privilege to true. But this privilege is not the proper privilege to do that..
I have thought to use websockets, load the posts editor and send the edited information over websockets and manage the request in the server, cheking if the actual user have privileges to do it (checking the [admins] tag). But i havent tried to do it, i will try soon
Is possible to open the composer with some function??
I have done a first version of my plugin!
Finally i have made the plugin sending and receiving the post over websockets and doing all by myself
We will use it on our forum, if someone want use this plugin -> https://github.com/segura2010/nodebb-plugin-topic-admins
I have other plugin in my github account
@alberto__segura May take a look at this later and maybe extend it to add a kitchen sink icon if required.