Skip to Content Skip to Menu

Moderators assigned to specific users

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago #302430 by sirweb
Replied by sirweb on topic Moderators assigned to specific users

krileon wrote: That trigger works perfectly fine. Your issue is likely with your Conditions or Access. Try removing your conditions and see if the redirect takes place.


I deleted the condition but unfortunately nothing changed.
Does the Output tab matter in this case? If so, what would you recommend`

Debug is on but reports nothing.
Can I somehow output more debug info?

Access to the action is set to Public/Everyone.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 8 months ago #302432 by krileon
Replied by krileon on topic Moderators assigned to specific users
The below works fine in my tests.

Global
Trigger: onBeforeUserProfileEditRequest
Type: Redirect
User: Automatic
Access: Everybody
Action
URL: index.php

This causes profile edit to always redirect back to home page. That triggers usage is as follows.

Code:
$_PLUGINS->trigger( 'onBeforeUserProfileEditRequest', array( $uid, &$msg, 1 ) );

Does the Output tab matter in this case? If so, what would you recommend`

Nope.

Can I somehow output more debug info?

Debugging should output if there's an issue, yes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago #302436 by sirweb
Replied by sirweb on topic Moderators assigned to specific users
Yes, I understand.
As it works in your tests, it must be something else that causes this issue.
Maybe my Group structure? I guess I have to dig there.
I use a structure as the one you suggested in your first answer in this thread.
Technically it works, but it is not user friendly at the moment.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 8 months ago #302474 by krileon
Replied by krileon on topic Moderators assigned to specific users
The above trigger is fired after the access check and the error message is output directly after the trigger. I've no idea why this isn't working for you. You could try using a Code action and just changing the message, which is var2. Example as follows.

Action
Method: PHP
Code:
Code:
$variables['var2'] = 'You do not have permission to edit this user!';
Parameters
Reference Variables: Variable 2


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • sirweb
  • sirweb
  • OFFLINE
  • Posts: 226
  • Thanks: 25
  • Karma: 2
6 years 8 months ago #302482 by sirweb
Replied by sirweb on topic Moderators assigned to specific users
We have done some serious group/Access level testing today.
Basically, it works with this Group structure:

Registered
- Club 1
- - Club 1 Board members
- - - Club 1 IT manager
- Club 2
- - Club 2 Board members
- - - Club 2 IT manager
- Club 3
- - Club 3 Board members
- - - Club 3 IT manager
... and so on ...

The IT manager level contains one local moderator, and some Central moderator staff (they are present in all groups at this level, I dont know if yhat is best practice but it works).

All IT manager groups are members of the Access level 'CB Moderators access'.

In CB Configuration, Moderators View Access Level is set to 'CB Moderators access' and
Allow Moderators to Edit User Profiles is set to 'Moderators and Super Users Only'.

An IT manager is stopped when trying to edit a member from the wrong club. Central moderators can edit all.
However, IT managers are NOT stopped when editing Ajax fields!
The Auto Action mentioned before never fires. (Kyle, if you like, I can give you access).

I do not find the error message "You cannot edit a `Club 3`. Only higher-level users have this power." in CBs language files.
It would be great if you could add this string to the language file.
If we cannot get the Auto Action to fire, it would be better to present the error in native language. :)

Conclusion: We are very close to a distributed moderation solution. :)

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 8 months ago #302494 by krileon
Replied by krileon on topic Moderators assigned to specific users
Big part of the problem is CB isn't designed for the scenario you're wanting. We don't have moderator assignment yet. It's planned in probably CB 3.0 where you'll be able to assign a user as moderator of another user or groups of users and the top down permission checks will be better handled.

However, IT managers are NOT stopped when editing Ajax fields!

Please retry with latest CB Core Fields Ajax build just released.

The Auto Action mentioned before never fires. (Kyle, if you like, I can give you access).

I don't know what to suggest here. Are you sure CB Auto Actions is public and published within CB > Plugin Management? There are triggers for the permission checks as well. onUsersPermission is fired on the permission check to ensure a user can't edit someone above them. You maybe able to utilize it as follows.

Global
Triggers: onUsersPermission
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
$variables['var4'] = 'You do not have permission to edit this user!';
Parameters
Reference Variables: Variable 4

Its trigger usage is as follows to show available variables.

Code:
$_PLUGINS->trigger( 'onUsersPermission', array( $user_ids, $action, $allow_myself, &$msg ) );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: sirweb

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum