Class DBGrantService


public class DBGrantService extends PaginatedDbService<GrantDTO>
  • Field Details

  • Constructor Details

  • Method Details

    • getForGranteesOrGlobal

      public com.google.common.collect.ImmutableSet<GrantDTO> getForGranteesOrGlobal(Set<GRN> grantees)
    • getForGrantee

      public com.google.common.collect.ImmutableSet<GrantDTO> getForGrantee(GRN grantee)
    • 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

      public List<GrantDTO> getForTargetAndGrantee(GRN target, GRN grantee)
    • getForTargetAndGrantees

      public List<GrantDTO> getForTargetAndGrantees(GRN target, Set<GRN> grantees)
    • create

      public GrantDTO create(GrantDTO grantDTO, @Nullable User currentUser)
    • create

      public GrantDTO create(GrantDTO grantDTO, String creatorUsername)
    • create

      public GrantDTO create(GRN grantee, Capability capability, GRN target, String creatorUsername)
    • ensure

      public GrantDTO ensure(GRN grantee, Capability capability, GRN target, String creatorUsername)
      Ensure that a grant with the requested or a higher capability exists.
      Returns:
      the created, updated or existing grant
    • update

      public GrantDTO update(GrantDTO updatedGrant, @Nullable User currentUser)
    • getAll

      public com.google.common.collect.ImmutableList<GrantDTO> getAll()
    • getForTarget

      public List<GrantDTO> getForTarget(GRN target)
    • deleteForGrantee

      public int deleteForGrantee(GRN grantee)
    • deleteForTarget

      public int deleteForTarget(GRN target)
    • getForTargetExcludingGrantee

      public List<GrantDTO> getForTargetExcludingGrantee(GRN target, GRN grantee)
    • getOwnersForTargets

      public Map<GRN,Set<GRN>> getOwnersForTargets(Collection<GRN> targets)
    • hasGrantFor

      public boolean hasGrantFor(GRN grantee, Capability capability, GRN target)