Custom Profile Field - Modify Permissions

Started by thunderchld, January 09, 2017, 09:17:27 AM

Previous topic - Next topic

thunderchld

Hello!

I'm looking to see if I can find an existing mod that will allow my users to see a custom field on their profile but not edit it.

For example, I have a field called "Outstanding Balance" that I want only the 'owner' of the account to see and my moderators (group is called "staff) to be able to edit.  I am not willing to make the moderators admin to edit this field.

Is there an existing mod that will allow this?  I'm happy to attempt my hand at writing this - though I'd most likely need some help.

Thanks!

Illori

you can by default set the field "Users can see this field; only admins can edit it" or User cannot see this field; owner and admins can edit it." does not look like by default you can let a group modify a field and not the owner and not let others view it. you would need a mod to do what you want. i am not sure if one exists.

moved to mod requests board.

thunderchld

Thank you!  I do apologize, I should have posted under the Mod Request board.

Since this is moved, It would be great if there was really three options.  I understand this would not be easy or quick, but this is something I need to work towards.

General Users:  View (y/n)
Owner:  View (y/n), Edit (y/n)
Admin*: View (y/n), Edit (y/n)

*Administrator being administrator group + identified membergroup(s).


Kindred

FYI, as far as SMF is concerned: Anyone with admin permissions is an admin, regardless of the actual membergroup (you could have 4 different group names with admin permissions; they would all pass the "is_admin" check)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

thunderchld

Thank you.  Due to past issues the people who are in the "staff" group are not admins.  Outside of the actual Administrator group, none of the membergroups have access to the admin panels.

I am open to suggestions on how to grant this group permissions in a way that would allow them to pass "is_admin" checks but not have access to the admin panel. We do not want them creating new boards or changing group membership or changing permissions. We are still working on the "moderation" settings.

Kindred

you have missed the entire point of group-based permissions.

1- the actual admin group has access to all permissions. period.
2- each individual group can be granted individual permissions, as defined....

in the CODE, you have two kinds of checks.

is_admin --- does this user have admin permissions? (e.g. is the user a member of group=1 (admin) or any other group which has been specifically granted admin permissions

check the permission based on the group setting  ---   does this user have permission to do this action as defined by a permission assigned to the group(s) that the user is in?



So, the permissions for your field would be

(by group)
Allow edit own entry
Allow edit other users' entry


by definition, admin (group 1) will have permission for both.
any other pseudo admins (any group other than 1) can be granted permission to edit their own and others' entries, just like any other group


If the field is editable, the admin should ALWAYS be able to edit it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

thunderchld

Thanks for that. I have not missed the point of group-based permissions. The group has proven they are unable to handle those permissions and I cannot get granular enough to grant them only certain access -(e.g. to modify a certain subset of member groups but not all).  I understand that the actual admin group has full permissions. That is limited to a very small handful of people.

We have created multiple groups and they have different permissions to different boards as we need them.   That is not my issue. My issue is that I need one of those groups to be able to see custom profile fields.

In my test site, I have granted group "staff"  admin permission to be able to manage Manage and assign membergroups.  This does not grant them the ability to see those custom fields. I added the entire admin section and this still did not grant them the abilities to see the custom fields.

thunderchld

I just wanted to bump this to see if there were other suggestions I could try.

Advertisement: