Grant write permission for all logged users

0 votes
Hello,

I am working on user permission in storage service module.

What I want to do is:

- Not logged users can Read document but not write
- Logged users can Read and Write all documents

(I want to perform this in all documents in one collection)

One solution is every time a new user is created grant write permission in all documents but I think is not a good solution.

How can I perform this in a better way?

Thank you very much,

German.
closed with the note: Resolved
asked Oct 29, 2015 in App42 Cloud API-BaaS by germanfv (18 points)
closed Nov 11, 2015 by germanfv

1 Answer

+1 vote

Hello German,

Apologies for getting late back to you.

You can manage it easily on the cline side by checking the LoggedInUser value. In order to check loggedInUser, please use below code snippet.

App42API.getLoggedInUser();

If it doesn't contain username than it means user is not loggedIn, so that you restrict on the UI side to not to operate Read/Write operation on the document. 

P.S Example code snippet is in Android, if you are working on different platform than let me know it will help us to provide better support to you.

Let me know if it helps.

Regards,

Himanshu Sharma

answered Oct 30, 2015 by hs00105 (2,005 points)
Hello Himanshu,

Thank you but my idea was to increase the app security through user permission.

If somebody steals my ApiKey/SecretKey and writes a code to send commands directly to the API, he could not write documents. (Only logged users could write documents)

Should I be worried about this?

Regards,
German.
Hello German,

In that case, i will suggest you to have a look at this tutorial(http://api.shephertz.com/tutorial/Securing-Your-App/?index=security-acl). This will help you to understand that how you can easily secure your app data.

If you find any issue while implementation or you need any help feel free to update this thread.

Regards,
Himanshu Sharma
Thank you!
Regards,
German.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...