Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
dacc07d1
Commit
dacc07d1
authored
Feb 13, 2020
by
Piotr Gawron
Browse files
documentation for granting/revoking project privileges
parent
ff34db52
Changes
2
Hide whitespace changes
Inline
Side-by-side
web/src/main/asciidoc/projects/project_privileges.adoc
0 → 100644
View file @
dacc07d1
= Rest API Documentation - Project privileges
Piotr Gawron
v{project-version} {build-time}
:toc: left
:sectnums:
== Grant privilege
Grant access to the project.
=== Path Parameters
include::{snippets}/projects/project_privileges/grant_privilege/path-parameters.adoc[]
=== Request Fields
include::{snippets}/projects/project_privileges/grant_privilege/request-fields.adoc[]
=== CURL sample
include::{snippets}/projects/project_privileges/grant_privilege/curl-request.adoc[]
== Revoke privilege
Revoke access to the project.
=== Path Parameters
include::{snippets}/projects/project_privileges/revoke_privilege/path-parameters.adoc[]
=== Request Fields
include::{snippets}/projects/project_privileges/revoke_privilege/request-fields.adoc[]
=== CURL sample
include::{snippets}/projects/project_privileges/revoke_privilege/curl-request.adoc[]
web/src/test/java/lcsb/mapviewer/web/ProjectControllerIntegrationTest.java
View file @
dacc07d1
...
...
@@ -213,11 +213,23 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
+
"\"login\":\""
+
CURATOR_LOGIN
+
"\""
+
"}]"
;
RequestBuilder
request
=
patch
(
"/projects/
"
+
TEST_PROJECT
+
"
:grantPrivileges"
)
RequestBuilder
request
=
patch
(
"/projects/
{projectId}
:grantPrivileges"
,
TEST_PROJECT
)
.
content
(
body
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andDo
(
document
(
"projects/project_privileges/grant_privilege"
,
pathParameters
(
parameterWithName
(
"projectId"
).
description
(
"project identifier"
)),
requestFields
(
fieldWithPath
(
"[]"
)
.
description
(
"list of privileges to grant"
)
.
type
(
"Array<Privilege>"
),
fieldWithPath
(
"[].privilegeType"
)
.
description
(
"type of privilege (READ_PROJECT/WRITE_PROJECT)"
)
.
type
(
"String"
),
fieldWithPath
(
"[].login"
)
.
description
(
"user login who should gain access"
)
.
type
(
"String"
))))
.
andExpect
(
status
().
is2xxSuccessful
());
assertTrue
(
curator
.
getPrivileges
().
contains
(
new
Privilege
(
PrivilegeType
.
READ_PROJECT
,
TEST_PROJECT
)));
...
...
@@ -235,11 +247,23 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
+
"\"login\":\""
+
CURATOR_LOGIN
+
"\""
+
"}]"
;
RequestBuilder
request
=
patch
(
"/projects/
"
+
TEST_PROJECT
+
"
:revokePrivileges"
)
RequestBuilder
request
=
patch
(
"/projects/
{projectId}
:revokePrivileges"
,
TEST_PROJECT
)
.
content
(
body
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andDo
(
document
(
"projects/project_privileges/revoke_privilege"
,
pathParameters
(
parameterWithName
(
"projectId"
).
description
(
"project identifier"
)),
requestFields
(
fieldWithPath
(
"[]"
)
.
description
(
"list of privileges to revoke"
)
.
type
(
"Array<Privilege>"
),
fieldWithPath
(
"[].privilegeType"
)
.
description
(
"type of privilege (READ_PROJECT/WRITE_PROJECT)"
)
.
type
(
"String"
),
fieldWithPath
(
"[].login"
)
.
description
(
"user login who should lose access"
)
.
type
(
"String"
))))
.
andExpect
(
status
().
is2xxSuccessful
());
assertFalse
(
curator
.
getPrivileges
().
contains
(
new
Privilege
(
PrivilegeType
.
READ_PROJECT
,
TEST_PROJECT
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment