Package org.graylog.security
Class DBGrantService
-
Field Summary
Fields inherited from class org.graylog2.database.PaginatedDbService
db
-
Constructor Summary
ConstructorDescriptionDBGrantService
(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapper, GRNRegistry grnRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(GRN grantee, Capability capability, GRN target, String creatorUsername) int
deleteForGrantee
(GRN grantee) int
deleteForTarget
(GRN target) ensure
(GRN grantee, Capability capability, GRN target, String creatorUsername) Ensure that a grant with the requested or a higher capability exists.com.google.common.collect.ImmutableList<GrantDTO>
getAll()
com.google.common.collect.ImmutableSet<GrantDTO>
getForGrantee
(GRN grantee) com.google.common.collect.ImmutableSet<GrantDTO>
getForGranteesOrGlobal
(Set<GRN> grantees) com.google.common.collect.ImmutableSet<GrantDTO>
getForGranteesOrGlobalWithCapability
(Set<GRN> grantees, Capability capability) com.google.common.collect.ImmutableSet<GrantDTO>
getForGranteeWithCapability
(GRN grantee, Capability capability) getForTarget
(GRN target) getForTargetAndGrantee
(GRN target, GRN grantee) getForTargetAndGrantees
(GRN target, Set<GRN> grantees) getForTargetExcludingGrantee
(GRN target, GRN grantee) getOwnersForTargets
(Collection<GRN> targets) boolean
hasGrantFor
(GRN grantee, Capability capability, GRN target) Methods inherited from class org.graylog2.database.PaginatedDbService
asImmutableList, delete, findPaginatedWithQueryAndSort, findPaginatedWithQueryFilterAndSort, findPaginatedWithQueryFilterAndSortWithGrandTotal, get, getMultiFieldSortBuilder, getPage, getSortBuilder, save, streamAll, streamByIds, streamQuery, streamQueryWithSort
-
Field Details
-
COLLECTION_NAME
- See Also:
-
-
Constructor Details
-
DBGrantService
@Inject public DBGrantService(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapper, GRNRegistry grnRegistry)
-
-
Method Details
-
getForGranteesOrGlobal
-
getForGrantee
-
getForGranteeWithCapability
public com.google.common.collect.ImmutableSet<GrantDTO> getForGranteeWithCapability(GRN grantee, Capability capability) -
getForGranteesOrGlobalWithCapability
public com.google.common.collect.ImmutableSet<GrantDTO> getForGranteesOrGlobalWithCapability(Set<GRN> grantees, Capability capability) -
getForTargetAndGrantee
-
getForTargetAndGrantees
-
create
-
create
-
create
-
ensure
Ensure that a grant with the requested or a higher capability exists.- Returns:
- the created, updated or existing grant
-
update
-
getAll
-
getForTarget
-
deleteForGrantee
-
deleteForTarget
-
getForTargetExcludingGrantee
-
getOwnersForTargets
-
hasGrantFor
-