Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] I would like for administrators to only be able to change one field of users profile

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago - 9 years 1 month ago #271151 by timstohr
Hey guys,

I have installed Ajax and I would like ONLY the administrators and super administrators to be able to change one or two fields of the profile of users (there is a whole chain of auto action behind these fields). I have now set that the administrators and super-admins can change the profile of users, but it seems a bit much if they can change anything on the profile.

I would like to limit it to this one field that is changeable for administrators/super-administrators.

Thanks

Tim

PS: How can I hide this change from being published automatically on the CB Activity?

EDIT: Trigger "After user profile update" does not work on AJAX fields (as it seems). Which trigger do I need to use so that an action happens after the update of an AJAX field by an admin?
Last edit: 9 years 1 month ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 1 month ago #271175 by krileon
I don't think you'll be able to do that. There's no features in place to limit moderator access to a select set of fields. You'd have to use a custom view access level on the tabs of those fields, but that'll limit editing of their own profile.

PS: How can I hide this change from being published automatically on the CB Activity?

Looks like the "Profile - Update" system action is missing a condition to ensure the viewing user is the profile owner. Edit "Profile - Update" within System Actions then under Conditions add the following condition.

[user_id] Equal To [cb:userdata field="user_id" user="#me" /]

Now click "Save as Copy". Next navigate back to System Actions and unpublish "Profile - Update". You should have a copy under "Actions" with your changes. Have added a bug ticket to fix this for next CB Auto Actions release.

EDIT: Trigger "After user profile update" does not work on AJAX fields (as it seems). Which trigger do I need to use so that an action happens after the update of an AJAX field by an admin?

The core fields ajax plugin does fire the onAfterUserUpdate trigger when a field value is changed.


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago #271214 by timstohr
Hi Kyle,

I had used "After update User" instead of "After User update". It works perfectly now that I have switched it around.

What is the difference?

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 1 month ago #271217 by nant

timstohr wrote: Hi Kyle,

I had used "After update User" instead of "After User update". It works perfectly now that I have switched it around.

What is the difference?


After update user - is a backend trigger (fires when a change is made in backend CB User Manager)

After User update - is a frontend trigger (fires when a profile update is made from frontend)

You could just use both triggers on the same action - this way action will work both in fe and be updates.

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

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago #271218 by timstohr
:) I know now why none of the changes that I was doing on the persons group was working. As soon as I changed the persons manually in a different user group, they got within firing range of the auto plugin and kicked them back out of the user group.

Good to know about the backend trigger as this will be useful for another project I have.

Thanks

Tim

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

Moderators: beatnantkrileon
Powered by Kunena Forum