Enable authorizations w/ dummy-auth (#158)
* Enable authorizations w/ dummy-auth * fixed: some tests run in privileged mode * Fixed tests to skip auth * npm test --silent * Added dependency to passport
This commit is contained in:
@@ -24,14 +24,14 @@ service ReviewsService {
|
||||
|
||||
|
||||
// Access control restrictions
|
||||
annotate ReviewsService.Reviews with @restrict_:[
|
||||
annotate ReviewsService.Reviews with @restrict:[
|
||||
{ grant:'READ', to:'any' }, // everybody can read reviews
|
||||
{ grant:'CREATE', to:'authenticated-user' }, // users must login to add reviews
|
||||
{ grant:'UPDATE', to:'authenticated-user', where:'reviewer=$user' },
|
||||
{ grant:'DELETE', to:'admin' },
|
||||
];
|
||||
|
||||
annotate ReviewsService with @restrict_:[
|
||||
annotate ReviewsService with @restrict:[
|
||||
{ grant:'like', to:'identified-user' },
|
||||
{ grant:'unlike', to:'identified-user', where:'user=$user' },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user