Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
2df04c34
Commit
2df04c34
authored
5 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-4121: check access right to user in full text search
parent
45446f43
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/search/service/indexer/identity/IdentityIndexer.java
+17
-5
17 additions, 5 deletions
...olat/search/service/indexer/identity/IdentityIndexer.java
with
17 additions
and
5 deletions
src/main/java/org/olat/search/service/indexer/identity/IdentityIndexer.java
+
17
−
5
View file @
2df04c34
...
@@ -20,12 +20,18 @@
...
@@ -20,12 +20,18 @@
package
org.olat.search.service.indexer.identity
;
package
org.olat.search.service.indexer.identity
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
org.olat.basesecurity.BaseSecurity
;
import
org.olat.basesecurity.BaseSecurity
;
import
org.olat.basesecurity.BaseSecurityManager
;
import
org.olat.basesecurity.BaseSecurityManager
;
import
org.olat.basesecurity.IdentityPowerSearchQueries
;
import
org.olat.basesecurity.OrganisationRoles
;
import
org.olat.basesecurity.SearchIdentityParams
;
import
org.olat.core.CoreSpringFactory
;
import
org.olat.core.commons.persistence.DBFactory
;
import
org.olat.core.commons.persistence.DBFactory
;
import
org.olat.core.id.Identity
;
import
org.olat.core.id.Identity
;
import
org.olat.core.id.OrganisationRef
;
import
org.olat.core.id.Roles
;
import
org.olat.core.id.Roles
;
import
org.olat.core.id.context.BusinessControl
;
import
org.olat.core.id.context.BusinessControl
;
import
org.olat.core.id.context.ContextEntry
;
import
org.olat.core.id.context.ContextEntry
;
...
@@ -46,11 +52,9 @@ import org.olat.search.service.indexer.OlatFullIndexer;
...
@@ -46,11 +52,9 @@ import org.olat.search.service.indexer.OlatFullIndexer;
* @author gnaegi, gnaegi@frentix.com, www.frentix.com
* @author gnaegi, gnaegi@frentix.com, www.frentix.com
*/
*/
public
class
IdentityIndexer
extends
AbstractHierarchicalIndexer
{
public
class
IdentityIndexer
extends
AbstractHierarchicalIndexer
{
public
final
static
String
TYPE
=
"type.identity"
;
public
static
final
String
TYPE
=
"type.identity"
;
/**
@Override
* @see org.olat.search.service.indexer.Indexer#getSupportedTypeName()
*/
public
String
getSupportedTypeName
()
{
public
String
getSupportedTypeName
()
{
return
Identity
.
class
.
getSimpleName
();
return
Identity
.
class
.
getSimpleName
();
}
}
...
@@ -100,6 +104,14 @@ public class IdentityIndexer extends AbstractHierarchicalIndexer {
...
@@ -100,6 +104,14 @@ public class IdentityIndexer extends AbstractHierarchicalIndexer {
if
(
roles
.
isGuestOnly
())
{
if
(
roles
.
isGuestOnly
())
{
return
false
;
return
false
;
}
}
return
true
;
Long
identityKey
=
contextEntry
.
getOLATResourceable
().
getResourceableId
();
List
<
OrganisationRef
>
organisations
=
roles
.
getOrganisationsWithRoles
(
OrganisationRoles
.
valuesWithoutGuestAndInvitee
());
SearchIdentityParams
params
=
new
SearchIdentityParams
(
null
,
null
,
false
,
null
,
null
,
null
,
null
,
null
,
null
,
Identity
.
STATUS_VISIBLE_LIMIT
);
params
.
setOrganisations
(
organisations
);
params
.
setIdentityKeys
(
Collections
.
singletonList
(
identityKey
));
List
<
Identity
>
ids
=
CoreSpringFactory
.
getImpl
(
IdentityPowerSearchQueries
.
class
).
getIdentitiesByPowerSearch
(
params
,
0
,
1
);
return
!
ids
.
isEmpty
();
}
}
}
}
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