ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

safecracker author

September 07, 2012 1:05pm

Subscribe [2]
  • #1 / Sep 07, 2012 1:05pm

    Alli

    158 posts

    I would like to allow just the original author and one other member to be able to edit a safecracker form.
    The other member would be indicated as a custom field entry in the channel entry they were updating.

    Is there a way of indicating this in the safecraker parameters?

  • #2 / Sep 10, 2012 5:34am

    Shane Eckert

    7174 posts

    Hello Alli,

    Thank you for your question!

    You could do something like this.

    {if author_id == logged_in_member_id OR logged_in_member_group == "5"} 
    <a href="http://templategroup/template">Edit This</a>
    {/if}

    Where group is the group that the member you want to be able to edit the form along with the author exists.

    Does that make sense?

    Cheers,

  • #3 / Sep 10, 2012 5:42am

    Alli

    158 posts

    Hi Shane
    I think that is heading in the right direction but it would need to be even more specific than member group as it will be only a single member of that group who should have editing rights - the plan would be that the author’s entry will include a field that includes the member id of the extra editior. So the code would need to be something like:

    {if author_id == logged_in_member_id OR logged_in_member_id == "{id pulled from the entry we are about to edit"} 
    <a href="http://templategroup/template">Edit This</a>
    {/if}
  • #4 / Sep 11, 2012 10:48am

    Shane Eckert

    7174 posts

    Hello Alli,

    Sounds like you just need to drop the OR then. author_id is the id from the entry that is about to be edited so the logic would be identical on both side of the OR.

    Does that makes sense?

    Cheers,

  • #5 / Sep 11, 2012 11:08am

    Alli

    158 posts

    Hi Shane
    I’m not sure I follow you - I’m trying to allow the author OR one other member to edit the entry. This other member id is the one that gets pulled from the entry custom field.
    Does that make sense?

  • #6 / Sep 12, 2012 10:19am

    Shane Eckert

    7174 posts

    Hello Alli,

    Gotcha.

    What is the name of the custom field? Does it work for you if you use “if logged_in_member_id == custome_field”?

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases