[SOLVED] Restrict view access on certain fields

6 years 1 month ago #302599 by krileon
Replied by krileon on topic Restrict view access on certain fields
CB Moderators are exempt from "Edit Display" in CB Privacy. They can always edit fields. It is unlikely you're going to be able to have the different moderator usages you're wanting as moderation in CB is not designed that way. Moderation in CB is an "all or nothing" approach at this time. I'm not sure what else to suggest other than trying to force the condition approach again. Example as follows.

Display: Field conditional show
Field: Custom > Value
Value: [cb:if user="#me" viewaccesslevel includes "VIEW_ACCESS_LEVEL_ID_HERE"]ACCESS[/cb:if]
Operator: Equal To
Value: ACCESS

Replace VIEW_ACCESS_LEVEL_ID_HERE with the actual id of the view access level you want the field restricted to. You will likely need to expand Locations and ensure it only applies to profile edit/view.


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 to join the conversation.

6 years 1 month ago #302608 by sirweb
Replied by sirweb on topic Restrict view access on certain fields
Ok, I see, same approach for both view access and edit access.
Thanks! :)

Please Log in to join the conversation.

6 years 1 month ago #302637 by sirweb
Replied by sirweb on topic Restrict view access on certain fields

krileon wrote: CB Moderators are exempt from "Edit Display" in CB Privacy. They can always edit fields. It is unlikely you're going to be able to have the different moderator usages you're wanting as moderation in CB is not designed that way. Moderation in CB is an "all or nothing" approach at this time. I'm not sure what else to suggest other than trying to force the condition approach again. Example as follows.

Display: Field conditional show
Field: Custom > Value
Value: [cb:if user="#me" viewaccesslevel includes "VIEW_ACCESS_LEVEL_ID_HERE"]ACCESS[/cb:if]
Operator: Equal To
Value: ACCESS

Replace VIEW_ACCESS_LEVEL_ID_HERE with the actual id of the view access level you want the field restricted to. You will likely need to expand Locations and ensure it only applies to profile edit/view.


Yes, this works just fine, thanks! :)
A (hopefully) final question before I start implementing on live site,
would it be possible to display the field value as read only in edit mode, instead of hiding it?

Please Log in to join the conversation.

6 years 1 month ago #302667 by krileon
Replied by krileon on topic Restrict view access on certain fields

would it be possible to display the field value as read only in edit mode, instead of hiding it?

You could probably use a Custom HTML field that substitutes in the profile view value of the field or even the raw value of the field then reverse the condition on it and set it to show below the actual field.


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 to join the conversation.

6 years 1 month ago - 6 years 1 month ago #302746 by sirweb
Replied by sirweb on topic Restrict view access on certain fields

krileon wrote: You could probably use a Custom HTML field that substitutes in the profile view value of the field or even the raw value of the field then reverse the condition on it and set it to show below the actual field.


Yes, this worked just fine! Thanks! :)

I set condition to 'Field conditional hide', everything else as you suggested above.
I also set under General tab, Show on Profile and Show on Registration to No.

Please mark this post as solved.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.224 seconds

Facebook Twitter LinkedIn