Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
d8688576
Verified
Commit
d8688576
authored
10 months ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Further hotfixing
parent
3dc42c8f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dbrepo-metadata-service/services/src/main/java/at/tuwien/service/impl/AccessServiceImpl.java
+11
-9
11 additions, 9 deletions
...c/main/java/at/tuwien/service/impl/AccessServiceImpl.java
dbrepo-ui/components/dialogs/EditAccess.vue
+4
-4
4 additions, 4 deletions
dbrepo-ui/components/dialogs/EditAccess.vue
with
15 additions
and
13 deletions
dbrepo-metadata-service/services/src/main/java/at/tuwien/service/impl/AccessServiceImpl.java
+
11
−
9
View file @
d8688576
...
@@ -65,8 +65,6 @@ public class AccessServiceImpl implements AccessService {
...
@@ -65,8 +65,6 @@ public class AccessServiceImpl implements AccessService {
public
DatabaseAccess
create
(
Database
database
,
User
user
,
AccessTypeDto
type
)
throws
DataServiceException
,
public
DatabaseAccess
create
(
Database
database
,
User
user
,
AccessTypeDto
type
)
throws
DataServiceException
,
DataServiceConnectionException
,
DatabaseNotFoundException
,
SearchServiceException
,
DataServiceConnectionException
,
DatabaseNotFoundException
,
SearchServiceException
,
SearchServiceConnectionException
{
SearchServiceConnectionException
{
/* create in data database */
dataServiceGateway
.
createAccess
(
database
.
getId
(),
user
.
getId
(),
type
);
/* create in metadata database */
/* create in metadata database */
final
DatabaseAccess
access
=
DatabaseAccess
.
builder
()
final
DatabaseAccess
access
=
DatabaseAccess
.
builder
()
.
hdbid
(
database
.
getId
())
.
hdbid
(
database
.
getId
())
...
@@ -78,6 +76,8 @@ public class AccessServiceImpl implements AccessService {
...
@@ -78,6 +76,8 @@ public class AccessServiceImpl implements AccessService {
database
.
getAccesses
()
database
.
getAccesses
()
.
add
(
access
);
.
add
(
access
);
database
=
databaseRepository
.
save
(
database
);
database
=
databaseRepository
.
save
(
database
);
/* create in data database */
dataServiceGateway
.
createAccess
(
database
.
getId
(),
user
.
getId
(),
type
);
/* create in search service */
/* create in search service */
searchServiceGateway
.
update
(
database
);
searchServiceGateway
.
update
(
database
);
log
.
info
(
"Created access to database with id {}"
,
database
.
getId
());
log
.
info
(
"Created access to database with id {}"
,
database
.
getId
());
...
@@ -89,23 +89,25 @@ public class AccessServiceImpl implements AccessService {
...
@@ -89,23 +89,25 @@ public class AccessServiceImpl implements AccessService {
public
void
update
(
Database
database
,
User
user
,
AccessTypeDto
access
)
throws
DataServiceException
,
public
void
update
(
Database
database
,
User
user
,
AccessTypeDto
access
)
throws
DataServiceException
,
DataServiceConnectionException
,
AccessNotFoundException
,
DatabaseNotFoundException
,
SearchServiceException
,
DataServiceConnectionException
,
AccessNotFoundException
,
DatabaseNotFoundException
,
SearchServiceException
,
SearchServiceConnectionException
{
SearchServiceConnectionException
{
/* update in data database */
dataServiceGateway
.
updateAccess
(
database
.
getId
(),
user
.
getId
(),
access
);
/* update in metadata database */
/* update in metadata database */
final
D
atabaseAccess
entity
=
DatabaseAccess
.
builder
()
final
int
idx
=
d
atabase
.
get
Access
es
().
indexOf
(
DatabaseAccess
.
builder
()
.
hdbid
(
database
.
getId
())
.
hdbid
(
database
.
getId
())
.
database
(
database
)
.
database
(
database
)
.
huserid
(
user
.
getId
())
.
huserid
(
user
.
getId
())
.
user
(
user
)
.
user
(
user
)
.
type
(
metadataMapper
.
accessTypeDtoToAccessType
(
access
))
.
type
(
metadataMapper
.
accessTypeDtoToAccessType
(
access
))
.
build
();
.
build
());
final
int
idx
=
database
.
getAccesses
().
indexOf
(
entity
);
if
(
idx
==
-
1
)
{
if
(
idx
==
-
1
)
{
log
.
error
(
"Failed to update access"
);
log
.
error
(
"Failed to update access"
);
throw
new
AccessNotFoundException
(
"Failed to find update access"
);
throw
new
AccessNotFoundException
(
"Failed to find update access"
);
}
}
final
DatabaseAccess
entity
=
database
.
getAccesses
()
.
get
(
idx
);
entity
.
setType
(
metadataMapper
.
accessTypeDtoToAccessType
(
access
));
database
.
getAccesses
().
set
(
idx
,
entity
);
database
.
getAccesses
().
set
(
idx
,
entity
);
database
=
databaseRepository
.
save
(
database
);
database
=
databaseRepository
.
save
(
database
);
/* update in data database */
dataServiceGateway
.
updateAccess
(
database
.
getId
(),
user
.
getId
(),
access
);
/* update in search service */
/* update in search service */
searchServiceGateway
.
update
(
database
);
searchServiceGateway
.
update
(
database
);
log
.
info
(
"Updated access to database with id {}"
,
database
.
getId
());
log
.
info
(
"Updated access to database with id {}"
,
database
.
getId
());
...
@@ -116,11 +118,11 @@ public class AccessServiceImpl implements AccessService {
...
@@ -116,11 +118,11 @@ public class AccessServiceImpl implements AccessService {
public
void
delete
(
Database
database
,
User
user
)
throws
AccessNotFoundException
,
DataServiceException
,
public
void
delete
(
Database
database
,
User
user
)
throws
AccessNotFoundException
,
DataServiceException
,
DataServiceConnectionException
,
DatabaseNotFoundException
,
SearchServiceException
,
DataServiceConnectionException
,
DatabaseNotFoundException
,
SearchServiceException
,
SearchServiceConnectionException
{
SearchServiceConnectionException
{
/* delete in data database */
dataServiceGateway
.
deleteAccess
(
database
.
getId
(),
user
.
getId
());
/* delete in metadata database */
/* delete in metadata database */
database
.
getAccesses
().
remove
(
find
(
database
,
user
));
database
.
getAccesses
().
remove
(
find
(
database
,
user
));
databaseRepository
.
save
(
database
);
databaseRepository
.
save
(
database
);
/* delete in data database */
dataServiceGateway
.
deleteAccess
(
database
.
getId
(),
user
.
getId
());
/* update in search service */
/* update in search service */
searchServiceGateway
.
update
(
databaseService
.
findById
(
database
.
getId
()));
searchServiceGateway
.
update
(
databaseService
.
findById
(
database
.
getId
()));
log
.
info
(
"Deleted access to database with id {}"
,
database
.
getId
());
log
.
info
(
"Deleted access to database with id {}"
,
database
.
getId
());
...
...
This diff is collapsed.
Click to expand it.
dbrepo-ui/components/dialogs/EditAccess.vue
+
4
−
4
View file @
d8688576
...
@@ -160,12 +160,12 @@ export default {
...
@@ -160,12 +160,12 @@ export default {
this
.
loading
=
true
this
.
loading
=
true
if
(
this
.
isModification
)
{
if
(
this
.
isModification
)
{
if
(
this
.
modify
.
type
===
'
revoke
'
)
{
if
(
this
.
modify
.
type
===
'
revoke
'
)
{
await
this
.
revokeAccess
()
this
.
revokeAccess
()
}
else
{
}
else
{
await
this
.
modifyAccess
()
this
.
modifyAccess
()
}
}
}
else
{
}
else
{
await
this
.
giveAccess
()
this
.
giveAccess
()
}
}
},
},
revokeAccess
()
{
revokeAccess
()
{
...
@@ -190,7 +190,7 @@ export default {
...
@@ -190,7 +190,7 @@ export default {
},
},
modifyAccess
()
{
modifyAccess
()
{
const
accessService
=
useAccessService
()
const
accessService
=
useAccessService
()
accessService
.
modify
(
this
.
$route
.
params
.
database_id
,
this
.
localUserId
,
this
.
modify
)
accessService
.
update
(
this
.
$route
.
params
.
database_id
,
this
.
localUserId
,
this
.
modify
)
.
then
(()
=>
{
.
then
(()
=>
{
const
toast
=
useToastInstance
()
const
toast
=
useToastInstance
()
toast
.
success
(
this
.
$t
(
'
success.access.modified
'
))
toast
.
success
(
this
.
$t
(
'
success.access.modified
'
))
...
...
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
register
or
sign in
to comment