Skip to content
Snippets Groups Projects
Commit 857c3cbf authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

fix authsome

parent 5b9ac3a9
No related branches found
No related tags found
1 merge request!8Sprint #10
......@@ -102,6 +102,13 @@ async function authenticatedUser(user, operation, object, context) {
}
}
if (
operation === 'POST' &&
object.path === '/collections/:collectionId/fragments'
) {
return true
}
// Allow the authenticated user to GET collections they own
if (operation === 'GET' && object === '/collections/') {
return {
......@@ -183,7 +190,7 @@ async function authenticatedUser(user, operation, object, context) {
return false
}
if (user.teams.length !== 0) {
if (user.teams.length !== 0 && operation === 'GET') {
const permissions = await teamPermissions(user, operation, object, context)
if (permissions) {
......
......@@ -102,6 +102,13 @@ async function authenticatedUser(user, operation, object, context) {
}
}
if (
operation === 'POST' &&
object.path === '/collections/:collectionId/fragments'
) {
return true
}
// Allow the authenticated user to GET collections they own
if (operation === 'GET' && object === '/collections/') {
return {
......@@ -183,7 +190,7 @@ async function authenticatedUser(user, operation, object, context) {
return false
}
if (user.teams.length !== 0) {
if (user.teams.length !== 0 && operation === 'GET') {
const permissions = await teamPermissions(user, operation, object, context)
if (permissions) {
......
......@@ -102,6 +102,13 @@ async function authenticatedUser(user, operation, object, context) {
}
}
if (
operation === 'POST' &&
object.path === '/collections/:collectionId/fragments'
) {
return true
}
// Allow the authenticated user to GET collections they own
if (operation === 'GET' && object === '/collections/') {
return {
......@@ -183,7 +190,7 @@ async function authenticatedUser(user, operation, object, context) {
return false
}
if (user.teams.length !== 0) {
if (user.teams.length !== 0 && operation === 'GET') {
const permissions = await teamPermissions(user, operation, object, context)
if (permissions) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment