Home › Toolset Professional Support › [Resolved] Access control for members
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
Tagged: Content Templates, Toolset Blocks, Views plugin
Related documentation:
This topic contains 15 replies, has 2 voices.
Last updated by brianC-15 4 years, 2 months ago.
Assisted by: Minesh.
Tell us what you are trying to do?
I want to grant access ONLY to the individual members profile from the front end
Is there any documentation that you are following?
I have followed the following course lesson
https://toolset.com/lesson-placement/lesson-placements-1621543-1622357/
and
https://toolset.com/lesson-placement/lesson-placements-1621543-1655635/
Is there a similar example that we can see?
Yes
hidden link
You have full access with the following logins
Username: ToolsetAdmin
PW: removed
I have developed a number of therapists profiles on the site ... most of them were built manually rather than filling out a registration form to create a role and then creating the profile from the front end, <b>so I realise that most of the profiles won't have the 'user role' of 'Therapist' as they haven't yet been set up and so won't have editing access</b>
However I created the user role of therapist, following the guides and then I used the
Registration Form to create a user called:
Ben Gold (he can be seen under the
Find A Therapist Nearby (pages) > Therapists in the City (page) > Ben Gold
His user log ins are:
User Name: Brian_Cotsen
Password: removed
I then followed the set up to give the template an edit button and connected it with the 'edit cred form' as per your instructions.
I CAN SEE THE EDIT BUTTON ON ALL THE PROFILES when i am logged in as the administrator
However I expected only to see the 'Edit' button on Ben Gold's profile page when I was logged in as 'Brian_cotsen' (i.e. a therapist logging in to be able to edit their own profile.
I can't see where I am going wrong, I think I have correctly granted access to 'Therapists' roles
What is the link to your site?
hidden link
You have full access with the following logins
Username: ToolsetAdmin
PW: removed
Hello. Thank you for contacting the Toolset support.
First of all - this is a public forum that is why you should not add access details publicly. If you want - you can ask supporter to send you private reply so that you can add access details so that it will be accessible to only you and support person.
I've removed the password you shared for security concern from your initial reply.
Now - what you are saying is that Edit link is accessible to your administrator user. Basically, administrator user will have all the rights and that is why they will have access to that edit link.
I'm not sure yet how exactly you have added the edit link. if you want that only the loggedin user with the role assigned "Therapist" should be able to access the edit link. There are two ways.
Either you can go for [toolset_access] shortcode and allow only the "Therapist" role so that the edit link will be displayed with that role only if you have installed and activate the Toolset Access plugin:
For example:
[toolset_access role="Therapist" operator="allow"] your edit link [/toolset_access]
Or
You can use the [wpv-conditional] shortcode to display the edit link conditionally. For example:
[wpv-conditional if="( '[wpv-current-user info='role']' eq 'therapist' )"] your edit link [/wpv-conditional]
This way the edit link will be displayed for only user who will loggedin as "therapist" role.
Please let me know if you have any concern or doubt.
Hello Minesh
Firstly thanks for removing the logins, I thought I should let you know how to log in as that is what I have had to do with previous support requests.
Secondly thank you for your support.
OK, so to your answer ... yes I am aware that if I am logged in as administrator of course i will see the 'edit' button at the top of each of the profile entries on the front end ... just like in the example in the video training for 'gyms' ... where we are shows how to add an 'edit' form and link it to the post page so that when registered members who have created their own profile want to edit the profile they can do so from the front end by clicking the edit button and accessing the edit form.
Here is the process steps I have taken so far.
1. created a registration form that a user uses to 'create a user account as a 'therapist' role' - this is working and I created several roles from the front end e.g. VossyK, TomShaw
2. created a profile by using the 'front end' form (that is the form that I want therapists who register with the website to use) to create a profile - this is also working and this can be seen by viewing 'Advanced Search' and then you will see both Karen Voss and Tom Shaw and be able to click through to their live profiles.
3. I have also given access control to 'therapists' to edit and delete their own posts - Not sure if this is working??? using the Access Control Screen
4. I have created a 'user form' to allow 'therapists' to 'edit' their profiles - tested and it works
5. I have added the form to the template used for the 'therapists profile' and you can see the word 'edit' in the image at the top of the screen shot - this only shows ON THE FRONT END when I am logged in as the administrator ... but it does not show when I log in as Karren Voss (I would expect to see the 'edit' button on her profile only)
6. The edit button takes me to the edit form (when I see it when logged in as administrator) but as I can't see it when logged in as a therapists (looking at their own profile) this is the issue I am trying to resolve (the second image showing the editable page)
So I am asking .... why can't I grant access to the individual 'therapist' (user) who created their own profile ... to allow them to edit is just as i have seen shown in the training video
https://toolset.com/lesson-placement/lesson-placements-1621521-1612073/
See the image i have clipped from that video example which shows the exact function I want to allow on my own site ... 'Gyms' = 'Therapists'
Hope this helps clarify what I want to do, what I have done so far and where the problem lies.
As always I do appreciate your help,
Regards
Brian
I checked by logged in to your site and I found that all posts of post type "therapist-in-london" the author of the post is user with user ID 3 - that is this user: hidden link
=> hidden link
There is no post whose author is the user "Brian_Cotsen". As all posts author is set as User ID 3 that is why its not working.
Basically, when you create a profile post using the Toolset form, you should set that post's author as a loggedin user. Also, I'm not sure how you created the role "therapist". Have you selected any option from the "Copy from role" dropdown while creating the new role?
If you can share from where user can create third profile from frontend using the Toolset form I can add the hook that will set the current loggedin user as the author of the newly created profile post.
Hello Manish
I realise you won't have seen my previous requests for help but yet again I am finding that the 'training' videos are falling short of the necessary knowledge and guidance that a new user of Toolset and perhaps of understanding 'posts' needs.
You say all the authors of the posts 'Therapists in London' are by User ID 3 ...
I can see under the 'Author' that indeed TomShaw seems to have been authored by BrinaC ... this is then the problem I don't understand ... I created TomShaw using a unique email 'tomshaw@consultant.com' and then I created my profile under tomshaw (therapist) login ... so I don't understand why it says Author BrianC ... this doesnt make any sense to me.
Please remember I am not a developer or that knowledgable about WordPress post creating ... I am follwing the instruction of your courses and I am told 'this is very easy' but obviously it is more complicated than your marketing suggests.
Please be clearer about this sentence ... I don't know what you are asking me to share?
If you can share from where user can create third profile from frontend using the Toolset form I can add the hook that will set the current loggedin user as the author of the newly created profile post.
Do you mean the registration form and then the profile creating form?
Do you mean the registration form and then the profile creating form?
==>
Yes.
I created TomShaw using a unique email 'tomshaw@consultant.com' and then I created my profile under tomshaw (therapist) login ... so I don't understand why it says Author BrianC ... this doesnt make any sense to me.
==>
That is strange.
If you can share the IRLs where I can find the registration form and profile creating form, I will try to create a new user and then using that user I will create a new profile using the post form and check whats going wrong with your setup.
I totally understand as a non-developer how difficult it could be fore you but first I will require to review the registration and profile creation steps and once I review and make a test I will be in better position to guide you in the right direction.
Hello Minesh
Registration form is here ... when you fill it out it takes you to the 'create a profile' form ... I changed this yesterday (after I created those other profiles)
hidden link
if you need the url of the create a profile it's here ... but you should go strait to it once you complete the 'registration form)
hidden link
I could not able to access the registration form if I'm not loggedin:
=> hidden link
The registration form should be available for guest user - correct? I mean even though I'm not loggedin, I should be allow to register to site - right?
Perhaps i need to temporarily 'deactivate the under construction plugin' I have this on so that only developers can access ... will deactivate it
It's now deactivated so you can see the website without logging in
Regards
Brian
Ah now I can see that when you go to the register page ... the page is empty ... how strange
Why is that I wonder
I just realised that I hadn't given the guest access to register using the new user form .... sorry ... it's now done
Hello Minesh
OK that's good ... perhaps it was that, until this morning, a guest couldn't register and so it was defaulting to me as the creator.
I am going to register a new user now and see if it does what i want it to do.
Love the car by the way!
Thanks for your help so far and I will report back and see what happens.
Regards
Brian
That is why its important to walk through the workflow. 🙂
Great and glad to see that its working. Please feel free to mark resolve this ticket once you confirm the things working as expected.
Have a great day!!
Hello Minesh
yes I understand, however I have just created a new profile for
silvia lautier
I have her new logins ...
But then when i signed in using her logins I cannot see the edit button for her profile?
Although if I sign out and then sign in using the new logins you created for mineh.s
I do see the edit button on your profile.
So there is still an issue.
Regards
Brian
You must be doing something wrong or there must be something wrong as I shared I do not able to see such issue.
Here are the steps I followed:
=> I registered a new user "minesh.s"
=> Then I navigate to: hidden link and loggedin as "minesh.s" user and created the profile using the form:
- hidden link
=> Once I submit the above form, I double checked the post author.
=> When I visit the post on frontend, I can see the edit link.
I can see with the post "Silvia Lautier" there is no author attached. You must be loggedin (please make sure).
=> hidden link