Non-Admin Capabilities
-
Hello,
My problem is to set the right capabilities for non-admins.
I want to allow my users to edit one specific table, when they click on “edit” in the frontend but they shouldnt be able to see all tables! I deleted the navigation bar and dashboard menu bar for tablepress so they cant click on “all tables” in the backend, but they can still access “all tables” via the direct url “…/admin.php?page=tablepress”. I have set the following capabilities:
tablepress_edit_tables
tablepress_list_tables (if removed = no access to tablepress backend)
tablepress_access_about_screen
tablepress_edit_optionsAny suggestions how to solve this?
-
Hi,
thanks for your post, and sorry for the trouble.
This is not that easy here, unfortunately. A user with “tablepress_edit_tables” will always have the right to edit (and therefore see) all tables. To change this, you would have to write custom code that adds checks about which table a user is allowed to edit, e.g. by using some plugin filter hooks.
Now, I do have plans to do this as part of a Premium/Pro Extension for TablePress, but that still needs some work. If that would be an option for you, please send me an email, so that we can maybe discuss about this. My address is in the main plugin file “tablepress.php”.Regards,
TobiasThank you for your quick response.
Could you please tell me where i find the code of the capabilities in your plugin?
I am sorry to tell you that premium extensions arent really an option for me since i am just a trainee who has to setup a new intranet in my company. Btw. greatest free table plugin so far 😉
Hi,
sorry for the long delay. As I was on vacation, I didn’t have a chance to reply earlier.
No worries, I totally understand that a Premium Extension is not something that you can consider at the moment.
You can find the code that is related to the capabilities in the model-options.php file. The function
add_access_capabilities()
there is responsible for adding them.Regards,
Tobias
- The topic ‘Non-Admin Capabilities’ is closed to new replies.