• Resolved Robswaimea

    (@robswaimea)


    The plugin looks nice… I see the “locked” icon in the column for the post…
    But the user is able to “click” Update.. and the post gets updated.

    Maybe I am misunderstanding the function of the plugin…
    or.. most likely me ??

    I was hoping to use this with a popular plugin Events Manager.
    Within Events Manger is an option for User Capability…
    such that you can control if a use can upload an image, ad a location etc etc…
    Contributor, Editor, Subscriber… etc..

    Events Manager (User Capability) has a “tick” box for Edit Events.. which must be ticked.. otherwise a user cannot put in the event..

    I have my users set at the Level of Subscriber.

    I don’t know if Events Manager is overriding your plugin’s user ability to Edit or Update a post (ie custom post type Events) with it’s own User Capability Options.

    I allow the user to enter their Event… but then I go back in and add my custom styling etc etc..
    And thusly I would like to lock the post/Event after my editing.. because the user always messes it up if they re-edit.

    As mentioned… it looks like Events Manage User Capability “Edit Events” may be overriding this plugin.

    Any thoughts..
    Thanks for your work.. the plugin looks nice.. probably works for “normal” people.

    • This topic was modified 7 years, 5 months ago by Robswaimea.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Robswaimea

    (@robswaimea)

    As an added note.. I just tried another plugin Lock Pages which seems very similar to yours…
    and I have the same issue.
    So once again.. its probably me not you situation.
    Thanks again for your time.

    Thread Starter Robswaimea

    (@robswaimea)

    Marking this as resolved because most likely a situation particular to my set up.

    Plugin Author andyexeter

    (@andyexeter)

    Hi Robswaimea,

    Sorry I haven’t replied sooner, I didn’t get a notification that you’d posted.

    I had a look into the plugin in question and I believe you’re right, they appear to handle managing/deleting of events internally using their own custom capabilities.

    If the plugin was to pass in the associated object_id with its calls to current_user_can, then you could get around this by filtering the capabilities Post Lockdown looks for with something like:

    
    add_filter('postlockdown_capabilities', function($caps) {
        $caps['delete_events'] = true;
        $caps['edit_events'] = true;
        return $caps;
    });
    

    However, this won’t work right now because they’re just calling current_user_can('delete_events') with no context, so Post Lockdown can’t lookup the associated object_id and see if it is locked or protected.

    It may be worth reaching out to the maintainers of the events plugin and asking if they can add the object ID into their calls to current_user_can.

    • This reply was modified 7 years, 5 months ago by andyexeter.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Probably me… not working for me… custom post type…’ is closed to new replies.