We would like our logged-in users to be able to add content to a table that all other logged-in users can see. We would also like to limit their editing abilities to only the entries they have created. Is this possible?
I don't quite understand your setup, but I believe we could make it work. If the dependency is a user role, for example, we could make it work.
If I have this table:
This is a manual table that has manually entered IDs from wp_users and roles from wp_usermeta:
So, then I go to create an SQL query based table which will display entries based on user roles using this query:
SELECT new_table.id AS ID,
new_table.role AS Role,
new_table.product AS Product,
new_table.amount AS Amount
FROM wp_wpdatatable_6 AS new_table
JOIN wp_usermeta AS new_table_1
ON new_table_1.user_id = %CURRENT_USER_ID%
AND new_table_1.meta_value LIKE CONCAT('%', new_table.role, '%')
When I'm logged in with user ID = 1, I see this:
When I'm logged in with user ID = 4, I see the same thing. And when I'm logged in as one of the subscribers, I can only see the rows where role = subscriber:
The only difference is that as a subscriber I don't have access to the back-end, so this confirms it is working on both front and back.
So, we're only left with hiding unnecessary columns, adding names, and so on.
Hope this helps.
If you purchase the plugin, and we figure out we can't get it to match your idea, you can ask for a refund within 15 days of purchase.
I appreciate the thorough response. Maybe this would explain a bit better... in the table configuration, there is a setting titled "Users see and edit only own data". I have attached a screenshot to show you.
We would want the functionality to "Edit only own data" but still be able to have the data be seen by other users. I suppose what we are looking for is table rows/cells that are editable with the Logged-in User ID (or similar) being the dependency as opposed to "permission" because we would like every user to be able to add data to the table. (This is an intranet scenario where all 150+ logged-in users are staff members needing to add content to the table on the front-end).
If you enable that option, your users would only be able to see and edit only their own data. There's no either/or in it.
That's why I suggested the workaround - with it, you'd be able to assign user roles to users, so they would be able to see entries of all users that share their user role.
One last question, using your role-based technique, can we have a role that is able to add content on the front end without permissions to delete content?
You can set the "Editor roles" in the Editing tab above the table, and choose which user roles will be able to edit the table. Then, you can choose which buttons will be included:
So, if you don't want them to delete anything, enable the other two buttons, but leave Delete unchecked.
Hello,
We would like our logged-in users to be able to add content to a table that all other logged-in users can see. We would also like to limit their editing abilities to only the entries they have created. Is this possible?
Thank you!
Court
Hello Court
Thank you for your purchase.
I don't quite understand your setup, but I believe we could make it work. If the dependency is a user role, for example, we could make it work.
If I have this table:
This is a manual table that has manually entered IDs from wp_users and roles from wp_usermeta:
So, then I go to create an SQL query based table which will display entries based on user roles using this query:
When I'm logged in with user ID = 1, I see this:
When I'm logged in with user ID = 4, I see the same thing. And when I'm logged in as one of the subscribers, I can only see the rows where role = subscriber:
The only difference is that as a subscriber I don't have access to the back-end, so this confirms it is working on both front and back.
So, we're only left with hiding unnecessary columns, adding names, and so on.
Hope this helps.
If you purchase the plugin, and we figure out we can't get it to match your idea, you can ask for a refund within 15 days of purchase.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Aleksander,
I appreciate the thorough response. Maybe this would explain a bit better... in the table configuration, there is a setting titled "Users see and edit only own data". I have attached a screenshot to show you.
We would want the functionality to "Edit only own data" but still be able to have the data be seen by other users. I suppose what we are looking for is table rows/cells that are editable with the Logged-in User ID (or similar) being the dependency as opposed to "permission" because we would like every user to be able to add data to the table. (This is an intranet scenario where all 150+ logged-in users are staff members needing to add content to the table on the front-end).
Would this be possible?
Thank you,
Court
That can't be done, Court
If you enable that option, your users would only be able to see and edit only their own data. There's no either/or in it.
That's why I suggested the workaround - with it, you'd be able to assign user roles to users, so they would be able to see entries of all users that share their user role.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Aleksander,
One last question, using your role-based technique, can we have a role that is able to add content on the front end without permissions to delete content?
Thank you,
Court
Hi again Court
You can set the "Editor roles" in the Editing tab above the table, and choose which user roles will be able to edit the table. Then, you can choose which buttons will be included:
So, if you don't want them to delete anything, enable the other two buttons, but leave Delete unchecked.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables