Skip Navigation

[Resolved] restrict access to form

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 8 months ago.

Author
Posts
#1085822

Tell us what you are trying to do?

Imagine a company website where HR enters information into a custom post type about an employee.

The employee then can log in to the site and go in and revise their own information (via a form?). Each employee can only access their own information.

#1086512

The very easiest way would be letting the HR entering the information in the backend, by setting up new WordPress users for each employee HR needs to enter information

Users can be enhanced with User Custom Fields, if you add some in Toolset > Custom Fields > User Fields.

Then, a Toolset Form to edit Users of that role (employe) can be created so to be placed in a page.

With Toolset Forms and Toolset Access, you can control who can use that form - and since it's an user edit form, you can set that the user can edit only his own data with it.

The steps to achieve this are generally explained here
https://toolset.com/documentation/user-guides/cred-user-forms/
https://toolset.com/documentation/user-guides/cred-user-forms/#editing-forms
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

If you instead want this as a Post Type, it's as well possible, but the Post would need to be set to have as author the User which HR is entering data abut.
Then, in Toolset Forms you would create a Post Edit Form, display it on those Posts, and in Toolset Access, you can then set the Form to be used only to edit own posts - since the Employe is set as author of "his" particular post, they can then only edit that one post with it.

This may be helpful if you want as well to search thru that data (employe data) which is not possible if it's a pure WordPress user.
This is only possible by mimicking the Users to a Post Type:
https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.