MyBB Community Forums

Full Version: Custom MyCode Permissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Being able to set permissions such as viewing and using MyCode from the admincp should be included in the core of MyBB; I mean, we have permissions for thread prefixes, so why not MyCode?
I absolutely agree that this needs implementation in 2.0

In my case, moderators use mycodes to make coloured notice boxes; if someone finds out the mycode it could be abused, and at the moment I take that risk.

I'll post this in the 2.0 suggestions if a search returns nothing
It's tricky. What happens when you remove some from a group being able to use a certain MyCode? Is it supposed to break all existing posts? Or when a moderator adds something to a user's post?
You raise valid points. It might be worth us looking in to how the previous plugins for 1.6 behaved in regards to that. If someone was removed then then it should only affect posts made from then on. I can see how this can get confusing quite quickly so I'm intrigued how the plugins did it.

However the bigger issue is as you say; moderator edits. Ideally it should follow the permissions of the post owner as the moderator would most likely have the mycode permissions anyway. Granted, a mod wouldn't be able to edit the post and add mycode that only the moderator has permissions for but that would just kind of be tough luck and to create a separate post.

Thoughts?
(2016-06-07, 08:33 AM)groovybluedog Wrote: [ -> ]You raise valid points. It might be worth us looking in to how the previous plugins for 1.6 behaved in regards to that. If someone was removed then then it should only affect posts made from then on. I can see how this can get confusing quite quickly so I'm intrigued how the plugins did it.

However the bigger issue is as you say; moderator edits. Ideally it should follow the permissions of the post owner as the moderator would most likely have the mycode permissions anyway. Granted, a mod wouldn't be able to edit the post and add mycode that only the moderator has permissions for but that would just kind of be tough luck and to create a separate post.

Thoughts?

I solved this problem a while ago.

I edited the MyCode parser and added two codes which only groups 3 and 4 could use (staff and administrators). The codes were [WARN] and [BAN] which would display "User was warned/banned for this post" respectively.

Whenever a post was edited by a staff member or administrator it would "lock" that post, preventing further edits by anyone not in groups 3 or 4.

I accomplished this by adding a new column to the posts table, when set to a value of 1, the post was locked, and when the value was 0, it was unlocked.

So automatically, when a moderator edited a user's post to add a [WARN] MyCode, it would lock the post from further edits so they could not remove it. It would then also add an 'unlock' button to the post, so if mistakenly done, it could be reverted and the post would become editable again by the user.
(2016-06-07, 09:01 AM)Marisa Wrote: [ -> ]
(2016-06-07, 08:33 AM)groovybluedog Wrote: [ -> ]You raise valid points. It might be worth us looking in to how the previous plugins for 1.6 behaved in regards to that. If someone was removed then then it should only affect posts made from then on. I can see how this can get confusing quite quickly so I'm intrigued how the plugins did it.

However the bigger issue is as you say; moderator edits. Ideally it should follow the permissions of the post owner as the moderator would most likely have the mycode permissions anyway. Granted, a mod wouldn't be able to edit the post and add mycode that only the moderator has permissions for but that would just kind of be tough luck and to create a separate post.

Thoughts?

I solved this problem a while ago.

I edited the MyCode parser and added two codes which only groups 3 and 4 could use (staff and administrators). The codes were [WARN] and [BAN] which would display "User was warned/banned for this post" respectively.

Whenever a post was edited by a staff member or administrator it would "lock" that post, preventing further edits by anyone not in groups 3 or 4.

I accomplished this by adding a new column to the posts table, when set to a value of 1, the post was locked, and when the value was 0, it was unlocked.

So automatically, when a moderator edited a user's post to add a [WARN] MyCode, it would lock the post from further edits so they could not remove it. It would then also add an 'unlock' button to the post, so if mistakenly done, it could be reverted and the post would become editable again by the user.

That is an excellent solution. I have something similar in place where I have a separate lock post functionality however it's time consuming to do those two processes separately and manage it; your solution is much better.

Is it still available and which version is it for?
The WARN / BAN situation could probably be more securely handled by Xthreads or other plugin (eg. no need to check BB code permissions).

I would have a custom post field that indicates none / warn / ban, then use some of the parser hooks to add an appropriate message to the post. Of course you would need a UI for moderators / admin to mark a post as warn / ban or clear that flag.