I want to user some login required validation like...
# prisma-whats-new
p
I want to user some login required validation like: Before User login he can't create other model reacord How can i put this?
n
@ppatidar hey 🙂 you can update the existing permissions to
AUTHENTICATED
from
EVERYONE
so only authenticated users will be able to create new data
p
Can I defind all the permission via CLI?
n
Not yet 🙂
p
Because I have user roles and i want to give permissions according to user roles
n
p
So i need to write query in Permission Query
Ok
I also want to write some business logic using AWS Lambda
Can you provide me some like how can i do this and setup
n
Here's a blog post that really helped me to understand AWS Lambda/Serverless: serverless.com/blog/2017-04-5-build-webshop-with-graphql-and-serverless/
👍 1
p
Thanks
Hello, I have set login reqired permission for the Test Model for the Create I have login the user using mutation { signinUser(email: { email: "user@email.com" password: "secret-password" }){ token } } Then I got token
How can i pass this token for other apis call for user authenticated or not?
Now I want to Create Test mutation { createTest(name: "Praveen Patidar") { id name } }
Getting Error: Insufficient permissions for this mutation
How to pass Auth token in createTest mutation call?
it's the
Authorization
header of the request
p
Can i call from Playground?
How to pass token there?
n
in the Playground, you can select the user that should run the request in the top right corner 🙂
p
Not there any option for select
n
You probably don't have an exisitng user 🙂
p
I have one user I'm using signinUser for login and getting token in response
n
Not there any option for select
can you make a screenshot? It works for me.
p

https://snag.gy/YAcXI6.jpg▾

n
ah, gotcha!
You need to open the playground in the Console
p
How can i this? please give me steps
n
are you in your Console?
p
Console means CLI
?
n
in this case I am talking about https://console.graph.cool 🙂
p
Yes There is one
Thanks
👍 1
Hello @nilan
I want to automatic record in my Test Model once user ceated on the system
How can i write this code to create record in test model when user created?
Please let me know?
n
hey you can use nested mutations for this 🙂 what's the name of the other type? is the
User
type connected to the other type?
p
I have User and Test models
Once user create then one dummy entry should be save on Test model
n
is there a relation between those two?
p
No
Any update on this?