Let's start with this I have Jobs, which would be added from the front end and backend as well, thouse jobs have to have Clients and Workers attached to them, which are basically users with differnt fields, the workers they have to have ability to login in the system, the clients maybe too in the future, that's why I would like to ask which will be the best way to accomplish this? I did some basic plugins in craft, but this one is more complicated and I woud like to ask for the best way of doing it. I was thinking if it's possible to use UserElementType to accomplish this. I'm very new in craft so some plugin or some code snipped would be veryhelpful for me thanks in advanced!
1 Answer
You likely won't need to write a plugin at all – you can easily create different user groups (e.g. "Workers" and "Clients") from the Control Panel, and grant those groups different permissions. An example of a permission is "Access the CP". The user group permissions will be automatically applied to any new users added to the group.
To create a user group, visit Settings -> Users in the CP. The edit form for a user group will have a plethora of checkboxes for every possible permission. Note that when checked, many of these checkboxes will actually reveal even more checkboxes, for even more fine grained control over permissions.
-
tnx for your answer, but can I have different custom fields to thouse users groups? for example: the client wont't have Document ID required field, but worker will have one.– AlexCommented May 29, 2015 at 21:21
-
Unfortunately not – all users/user groups share the same custom fields. Commented May 30, 2015 at 12:36
-
There's a relevant feature request up at the Feedback site: feedback.buildwithcraft.com/forums/285221-feature-requests/…. Commented May 31, 2015 at 9:37