Class ResourcePermission
- java.lang.Object
- 
- org.keycloak.authorization.permission.ResourcePermission
 
- 
 public class ResourcePermission extends Object Represents a permission for a given resource.- Author:
- Pedro Igor
 
- 
- 
Constructor SummaryConstructors Constructor Description ResourcePermission(Resource resource, Collection<Scope> scopes, ResourceServer resourceServer)ResourcePermission(Resource resource, Collection<Scope> scopes, ResourceServer resourceServer, Map<String,? extends Collection<String>> claims)ResourcePermission(Resource resource, ResourceServer resourceServer, Map<String,? extends Collection<String>> claims)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddClaim(String name, String value)Adds a permission claim with the given name and a single value.voidaddClaims(Map<String,Set<String>> claims)voidaddScope(Scope scope)Map<String,Set<String>>getClaims()Returns all permission claims.ResourcegetResource()Returns the resource to which this permission applies.ResourceServergetResourceServer()Returns the resource server associated with this permission.Collection<Scope>getScopes()Returns a list of permitted scopes associated with the resourcebooleanisGranted()voidremoveClaim(String name)Removes a permission claim.voidsetGranted(boolean granted)
 
- 
- 
- 
Constructor Detail- 
ResourcePermissionpublic ResourcePermission(Resource resource, Collection<Scope> scopes, ResourceServer resourceServer) 
 - 
ResourcePermissionpublic ResourcePermission(Resource resource, ResourceServer resourceServer, Map<String,? extends Collection<String>> claims) 
 - 
ResourcePermissionpublic ResourcePermission(Resource resource, Collection<Scope> scopes, ResourceServer resourceServer, Map<String,? extends Collection<String>> claims) 
 
- 
 - 
Method Detail- 
getResourcepublic Resource getResource() Returns the resource to which this permission applies.- Returns:
- the resource to which this permission applies
 
 - 
getScopespublic Collection<Scope> getScopes() Returns a list of permitted scopes associated with the resource- Returns:
- a lit of permitted scopes
 
 - 
getResourceServerpublic ResourceServer getResourceServer() Returns the resource server associated with this permission.- Returns:
- the resource server
 
 - 
addClaimpublic boolean addClaim(String name, String value) Adds a permission claim with the given name and a single value. If a claim already exists, the value is added to list of values of the existing claim - Parameters:
- name- the name of the claim
- value- the value of the claim
 
 - 
removeClaimpublic void removeClaim(String name) Removes a permission claim. - Parameters:
- name- the name of the claim
 
 - 
addScopepublic void addScope(Scope scope) 
 - 
setGrantedpublic void setGranted(boolean granted) 
 - 
isGrantedpublic boolean isGranted() 
 
- 
 
-