• Resolved shehurin

    (@shehurin)


    Hi.
    I have a task: I need to give access to contributor to creating tables. I used default caps for this: tablepress_list_tables, tablepress_add_tables, tablepress_delete_tables.

    Contributors can delete own tables and tables created from other users. It’s not safety I think.
    So I need to get contributors access to delete only own tables.

    I decided to solve my problem by filtering tables list in menu “All Tables”. So contributor wouldn’t see tables created other users, so he couldn’t delete them.

    Help me to find hook (filter) responsible for list tables. Or we have any solution to fix this safety problem?
    Thanks.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Just hiding the other tables from the Contributors will not be sufficient. You must implement sufficient capability checks here, e.g. also using the map_meta_cap plugin filter hook that WordPress offers.
    (There will be a premium feature in the upcoming TablePress 2.0 that will allow giving access rights to individual tables to individual users.)

    That said, make sure to also use the tablepress_edit_tables capability. The list of tables can be filtered via the tablepress_load_all_tables filter hook.

    Regards,
    Tobias

    Thread Starter shehurin

    (@shehurin)

    It helps, thank you

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias
    ?
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter tables list’ is closed to new replies.