0

I'm currently developing a Windows 8 app which uses Azure for its database. In this database I have 4 tables:

PlaceGroup
Places
PlaceComments
PlaceEvents

I want to make some sort of account system, where the user is permitted to update/delete only his place, i.e. only the records with his id. Example:

I have a place with id=5

The PlaceComments table has these records table structure: id PlaceID CommentBody


first record:
1 5 "Some text here"

second record
2 12 "Some text here"

I should be ONLY able to update/delete the second record. I really don't have an idea how to do it, so I'm asking for some help.

2
  • 1
    how are you accessing Azure - I assume you mean Windows Azure SQL Database? Through a web service of your own or through Windows Azure Mobile Services? Commented Nov 12, 2012 at 20:29
  • Yes, I access it through azure mobile service and it's a Azure SQL database (though this might change in the future, but for now it will stay this way) Commented Nov 13, 2012 at 15:15

1 Answer 1

1

Take a look at the Get started with authentication in Mobile Services tutorial and the follow-on: Use scripts to authorize users in Mobile Services.

In a nutshell, you'll need to include authentication in your application, which you can also do via Mobile Services. With authentication in place, you'll set the various scripts on your table to support "Only Authenticated Users"

WAMS Permission drop down

As a result of the authentication, you'll get a 'userid' identifying the authenticated user, that user info is then passed into the various scripts, so you could use that identifier to match only rows that have a column indicating the 'owner' of the various row of data (essentially adding a WHERE user = to all of your queries). Essentially creating a multi-tenanted implementation.

WAMS Script

Sign up to request clarification or add additional context in comments.

1 Comment

you're welcome... if the response works for you, please do mark it as answered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.