customUser field automatically add a user group field in the component config #484
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#484
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Create a customUser field type, add it to look admin view of Demo component, compile and upload the component
Expected result
To find the customUser field added to look admin view ONLY
Actual result
The customUser field is correctly added in the admin view, but also a user group field is automatically added to the component config.
This user group field is named with the code I assigned as "type" to the customUser field, but has an arbitrary name, arbitrary description and is added in an arbitrary tab, which has even an arbitrary note field.
Example:
I set a customUser field like:
type: customUser
name: myCustomName
description: myCustomDescription
I find an arbitrary userGroup type field in the component configuration, in a tab named "target groups", which is positioned between "General" and "Uikit2 settings" with:
name: myCustomName
label: User Group
description: set the user group/s being targeted by this user type
What is this? What does it means?
System information (as much as possible)
Additional comments
This is part of how custom user fields works, since if all you want is a user field then just create one using the normal user-field. But the custom user-field you are able to target only a specific group of users. So JCB adds that field to the config so you can select what those groups should be in your component.
This is not a bug, but yet again another feature of JCB that I have not yet fully explained. You see it is like the ice burg on the website JCB has so much more happening under the hood then you would see above the surface.
We have another component that you can also get the JCB pagkage key if you forked the project called Cost Benefit Projection it has three custom user groups,
serviceprovideruser
countryuser
andmemberuser
so each has it own customfield:We then use these relationships to control access.
You can achieve much of this with the access levels in Joomla, but with custom user groups you get an extra layer for even more permission settings.
So the custom usergroups naturally require a getGroups function and since we need that value to be dynamic... JCB adds it to your component for you.
Here is the areas that build this:
So like said before if you just need a normal user group that returns all users then use the default but if you would like to target a selected group... this is the purpose of the custom-user-group field.