Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
T
TreeApi
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
apis
TreeApi
Commits
5517eff0
This project is archived. Its data is
read-only
.
Commit
5517eff0
authored
Jun 21, 2021
by
Petar Hristov
Browse files
Options
Downloads
Plain Diff
Merge branch 'Sprint/2021-11' into 'master'
Sprint/2021 11 See merge request
!36
parents
55546715
c9e5d9b6
No related branches found
No related tags found
1 merge request
!36
Sprint/2021 11
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Tree/Controllers/TreeController.cs
+13
-9
13 additions, 9 deletions
src/Tree/Controllers/TreeController.cs
with
13 additions
and
9 deletions
src/Tree/Controllers/TreeController.cs
+
13
−
9
View file @
5517eff0
using
Coscine.WaterbutlerHelper
;
using
Coscine.WaterbutlerHelper
;
using
Coscine.WaterbutlerHelper.ReturnObjects
;
using
Coscine.ApiCommons
;
using
Coscine.ApiCommons.Factories
;
...
...
@@ -94,6 +94,10 @@ namespace Coscine.Api.Tree.Controllers
var
user
=
_authenticator
.
GetUser
();
var
check
=
CheckResourceIdAndPath
(
resourceId
,
path
,
out
Resource
resource
);
if
(
check
!=
null
)
{
return
check
;
}
if
(
resource
.
ApplicationProfile
[^
1
]
!=
'/'
)
{
...
...
@@ -102,12 +106,7 @@ namespace Coscine.Api.Tree.Controllers
if
(
user
==
null
||
!
_resourceModel
.
HasAccess
(
user
,
resource
,
UserRoles
.
Owner
,
UserRoles
.
Member
))
{
return
Forbid
(
"User has no Access to this resource."
);
}
if
(
check
!=
null
)
{
return
check
;
return
BadRequest
(
"User has no Access to this resource."
);
}
try
...
...
@@ -223,7 +222,12 @@ namespace Coscine.Api.Tree.Controllers
if
(
user
==
null
||
!
_resourceModel
.
HasAccess
(
user
,
resource
,
UserRoles
.
Owner
,
UserRoles
.
Member
))
{
return
Forbid
(
"User is no project member!"
);
return
BadRequest
(
"User is no project member!"
);
}
if
(
resource
.
Archived
==
"1"
)
{
return
BadRequest
(
"The resource is readonly!"
);
}
if
(
resource
.
ApplicationProfile
[^
1
]
!=
'/'
)
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment