Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Database
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
libraries
Database
Merge requests
!134
Product/1414 fh privileges
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Product/1414 fh privileges
Product/1414-fhPrivileges
into
Sprint/2021-08
Overview
1
Commits
2
Pipelines
1
Changes
2
Merged
L. Ellenbeck
requested to merge
Product/1414-fhPrivileges
into
Sprint/2021-08
4 years ago
Overview
1
Commits
2
Pipelines
1
Changes
2
Expand
coscine/issues#1414
0
0
Merge request reports
Compare
Sprint/2021-08
Sprint/2021-08 (base)
and
latest version
latest version
af7ecb06
2 commits,
4 years ago
2 files
+
7
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/Database/Models/ProjectModel.cs
+
4
−
9
Options
@@ -131,7 +131,7 @@ namespace Coscine.Database.Models
});
}
public
Project
StoreFromObject
(
ProjectObject
projectObject
,
User
user
,
bool
isRWTHMember
=
false
)
public
Project
StoreFromObject
(
ProjectObject
projectObject
,
User
user
,
IDictionary
<
string
,
int
>
defaultQuota
)
{
if
(!
projectObject
.
Disciplines
.
Any
()
||
!
projectObject
.
Organizations
.
Any
())
{
@@ -158,7 +158,7 @@ namespace Coscine.Database.Models
{
SetDisciplines
(
project
,
projectObject
.
Disciplines
);
SetOrganizations
(
project
,
projectObject
.
Organizations
);
SetQuotas
(
project
,
isRWTHMember
);
SetQuotas
(
project
,
defaultQuota
);
}
catch
(
Exception
)
{
@@ -252,22 +252,17 @@ namespace Coscine.Database.Models
}
}
p
rivate
void
SetQuotas
(
Project
project
,
bool
IsRWTHMember
=
false
)
p
ublic
void
SetQuotas
(
Project
project
,
IDictionary
<
string
,
int
>
defaultQuotas
)
{
ProjectQuotaModel
projectQuotaModel
=
new
ProjectQuotaModel
();
ResourceTypeModel
resourceTypeModel
=
new
ResourceTypeModel
();
foreach
(
var
resourceType
in
resourceTypeModel
.
GetAll
())
{
var
quota
=
25
;
if
((
resourceType
.
DisplayName
.
Equals
(
"rds"
)
&&
!
IsRWTHMember
)
||
resourceType
.
DisplayName
.
Equals
(
"rdss3"
))
{
quota
=
0
;
}
projectQuotaModel
.
Insert
(
new
ProjectQuota
{
ProjectId
=
project
.
Id
,
ResourceTypeId
=
resourceType
.
Id
,
Quota
=
quota
Quota
=
defaultQuotas
!=
null
&&
defaultQuotas
.
ContainsKey
(
resourceType
.
DisplayName
)
?
defaultQuotas
[
resourceType
.
DisplayName
]
:
0
});
}
}
Loading