Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
B
BlobApi
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
BlobApi
Commits
787db9b9
This project is archived. Its data is
read-only
.
Commit
787db9b9
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
!37
parents
8f51133f
1ec6b8ac
No related branches found
No related tags found
1 merge request
!37
Sprint/2021 11
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Blob/Controllers/BlobController.cs
+13
-2
13 additions, 2 deletions
src/Blob/Controllers/BlobController.cs
with
13 additions
and
2 deletions
src/Blob/Controllers/BlobController.cs
+
13
−
2
View file @
787db9b9
using
Coscine.ApiCommons
;
using
Coscine.ApiCommons
;
using
Coscine.Configuration
;
using
Coscine.Database.DataModel
;
using
Coscine.Database.Models
;
...
...
@@ -106,7 +106,7 @@ namespace Coscine.Api.Blob.Controllers
if
(
user
==
null
||
!
_resourceModel
.
HasAccess
(
user
,
resource
,
UserRoles
.
Owner
,
UserRoles
.
Member
))
{
return
Forbid
(
"User does not have permission to the resource."
);
return
BadRequest
(
"User does not have permission to the resource."
);
}
if
((
resource
.
Type
.
DisplayName
.
ToLower
()
==
"rds"
||
resource
.
Type
.
DisplayName
.
ToLower
()
==
"rdss3"
)
&&
resource
.
ResourceTypeOptionId
.
HasValue
)
...
...
@@ -210,6 +210,11 @@ namespace Coscine.Api.Blob.Controllers
return
checkUser
;
}
if
(
resource
.
Archived
==
"1"
)
{
return
BadRequest
(
"The resource is readonly!"
);
}
if
(
files
.
Count
!=
1
)
{
return
BadRequest
(
$"Only one file can be uploaded per request."
);
...
...
@@ -277,6 +282,12 @@ namespace Coscine.Api.Blob.Controllers
{
return
checkUser
;
}
if
(
resource
.
Archived
==
"1"
)
{
return
BadRequest
(
"The resource is readonly!"
);
}
try
{
var
resourceTypeOptions
=
_resourceModel
.
GetResourceTypeOptions
(
resource
.
Id
);
...
...
...
...
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