Making Sure Members Only See Their Entries
Posted: 06 December 2010 08:14 AM   [ Ignore ]
Wallflower
Avatar
Rank
Total Posts:  8
Joined  2010-12-02

I’m not sure if this is SafeCracker-specific or ExpressionEngine-specific, but here’s my situation and question:

I’m using SC for a job-application formâ??each application submission becomes a channel entry; typical stuff I imagine. I’m using the applicant’s first and last name as the Title field, seen here in the first chunk of code:

<h1>Application</h1>
{exp:safecracker channel="employment_application" return="main/index" url_title="{segment_3}" preserve_checkboxes="yes"}
    
<ul>
        <
li>
            <
label for="appFirstLastName">First &ampLast Name</label><br />
            <
input type="text" name="title" id="appFirstLastName" value="{title}" />
        </
li>
        <
li>
            <
label for="appPhoneNumber">Your Phone Number</label><br />
            <
input type="text" name="emp_app_phone_number" id="appPhoneNumber" value="{emp_app_phone_number}" />
        </
li>
        <
li>
            <
label for="appEmailAddress">Your Email Address</label><br />
            <
input type="text" name="emp_app_email_address" id="appEmailAddress" value="{emp_app_email_address}" />
        </
li>
        ... 

â?¦and, using the url_title parameter as I am, it’s easy to pull up the applicant’s submitted data with a URL such as website.com/index.php/thing/app/john_smith

All is well.

BUT, then I imagine an evil John Smith saying to himself, “Hmm, I wonder if I can pull up other people’s applications using the obvious pattern I see in the URL. I’ll try jack_jones, or susan_crabtree, or billy_awesomepants,” and so on.

Now, I was smart enough to set the member group preference to disallow editing of other member’s entries and it certainly works, but it doesn’t stop Evil John Smith from pulling up other people’s entries when correctly guessing their names and sticking them at the end of the URL. So, Evil John can see other people’s data, but he can’t edit it. That’s decent, but not good enough of course.

Is there something I need to do in the SC tag(s) to basically say “The member who is logged in can only view entries generated by themselves, even if they correctly guess the url_title of other applicant’s entries.”

Is that even an SC thing, or is it an EE thing?

Many thanks for any advice/help provided!

Profile
 
 
Posted: 06 December 2010 08:17 AM   [ Ignore ]   [ # 1 ]
Wallflower
Avatar
Rank
Total Posts:  8
Joined  2010-12-02

â?¦also, I forgot to mention that I also have the following settings in placeâ??the first and third settings are set to “No,” and you’d think that first one would solve my problem, but it doesn’t. (see attached file)

Profile
 
 
Posted: 06 December 2010 09:52 PM   [ Ignore ]   [ # 2 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

You can use the author_only=“yes” parameter on your form. That’ll restrict it from being edited by others.

Profile
 
 
Posted: 06 December 2010 09:58 PM   [ Ignore ]   [ # 3 ]
Wallflower
Avatar
Rank
Total Posts:  8
Joined  2010-12-02

Ah, perfect! I saw that parameter but didn’t consider it only because it’s labeled ‘edit entry’ rather than ‘edit or view entry.’ I wrongly assumed that using the parameter would still allow anybody to view somebody else’s entries.

Thanks Rob!

Profile