Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
4fcb2b10
Commit
4fcb2b10
authored
1 year ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-14261 : Slow user roles filtering
parent
23e59020
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java
+35
-0
35 additions, 0 deletions
...ystemsx/cisd/openbis/generic/server/task/UserManager.java
with
35 additions
and
0 deletions
server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/task/UserManager.java
+
35
−
0
View file @
4fcb2b10
...
@@ -1553,6 +1553,41 @@ public class UserManager
...
@@ -1553,6 +1553,41 @@ public class UserManager
}
}
if
(
roleCreations
.
isEmpty
()
==
false
)
if
(
roleCreations
.
isEmpty
()
==
false
)
{
{
// Filter out already existing roles to not repeat creations
// This is to manage a corner case when a user role has been added manually unnecessarily.
List
<
RoleAssignmentCreation
>
filteredRoleCreations
=
new
ArrayList
<>();
for
(
RoleAssignmentCreation
roleAssignmentCreationToCheck
:
roleCreations
)
{
PersonPermId
userId
=
(
PersonPermId
)
roleAssignmentCreationToCheck
.
getUserId
();
SpacePermId
spaceId
=
(
SpacePermId
)
roleAssignmentCreationToCheck
.
getSpaceId
();
RoleAssignmentSearchCriteria
roleAssignmentSearchCriteria
=
new
RoleAssignmentSearchCriteria
();
roleAssignmentSearchCriteria
.
withUser
().
withUserId
()
.
thatEquals
(
userId
.
getPermId
());
roleAssignmentSearchCriteria
.
withSpace
().
withCode
()
.
thatEquals
(
spaceId
.
getPermId
());
SearchResult
<
RoleAssignment
>
roleAssignmentSearchResult
=
service
.
searchRoleAssignments
(
sessionToken
,
roleAssignmentSearchCriteria
,
new
RoleAssignmentFetchOptions
());
boolean
found
=
false
;
if
(!
roleAssignmentSearchResult
.
getObjects
().
isEmpty
())
{
Role
role
=
roleAssignmentCreationToCheck
.
getRole
();
for
(
RoleAssignment
roleAssignment
:
roleAssignmentSearchResult
.
getObjects
())
{
if
(
roleAssignment
.
getRole
().
equals
(
role
))
{
found
=
true
;
}
}
}
if
(!
found
)
{
filteredRoleCreations
.
add
(
roleAssignmentCreationToCheck
);
}
}
roleCreations
=
filteredRoleCreations
;
operations
.
add
(
new
CreateRoleAssignmentsOperation
(
roleCreations
));
operations
.
add
(
new
CreateRoleAssignmentsOperation
(
roleCreations
));
}
}
if
(
roleDeletions
.
isEmpty
()
==
false
)
if
(
roleDeletions
.
isEmpty
()
==
false
)
...
...
This diff is collapsed.
Click to expand it.
juanf
@juanf
mentioned in commit
afc7467e
·
1 year ago
mentioned in commit
afc7467e
mentioned in commit afc7467eac52bc5776834942522b6944b6f15186
Toggle commit list
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