Hello! Just a little question about permissions f...
# prisma-whats-new
f
Hello! Just a little question about permissions format into
graphcool.yml
Copy code
permissions:
  # User
- operation: User.create
- operation: User.delete
  authentificate: true
- operation: User.update
  authentificate: true
- operation: User.read
  authentificate: true
Can I use any wildcard notation to shorter this?
n
User.*
should work
ah actually no, since
User.create
doesnโ€™t require authentication
f
Good! Any order issue?
n
(also itโ€™s
authenticated
, not
authentificate
๐Ÿ™‚ )
f
(thank for the misspelled ^^)
Copy code
- operation: User.create
- operation: User.*
  authenticated: true
or
Copy code
- operation: User.*
- operation: User.create
  authenticated: true
I don't know the override rules
or nothing will work in this case ?
The second pattern make the most sense to me, but I really don't know if graphcool understand this kind of rules ๐Ÿ™‚
But maybe I will just make my own tests ๐Ÿ˜‰
BTW, any graphcool tools to test easily policies?
n
f
๐Ÿ‘
n
also: I was wrong,
User.*
is actually not available at the moment! sorry for the wrong info, itโ€™ll come soon but is currently not implemented! so I think you have to stick to your initial version, spelling out all permissions explicitly. ๐Ÿ˜ again, sorry for the false info!
f
It can explain my issue ^^
ร— unhandled error: Wrong operation defined for ModelPermission. You supplied: '*'
Thank ๐Ÿ˜‰
When I see "wildcard" into the template message about policies, my first try was to do some
User.*
, maybe you can add a warning waiting for the full wildcard implementation ๐Ÿ˜‰
@nikolasburk Do you know how the rules are override. Basically, can I write something like think?
Copy code
- operation: *
- operation: User.create
  authenticated: true
Classic blacklist pattern in this case
n
no that doesnโ€™t work. in this card, the
"*"
will override everything else
f
Ok ๐Ÿ˜‰
So, it's just a white list pattern, cool ๐Ÿ™‚
๐Ÿ‘ 1
Thanks for your time
๐Ÿ™ 1