Interface ClientPermissionEvaluator
public interface ClientPermissionEvaluator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanConfigure(org.keycloak.models.ClientModel client) booleancanList()booleanbooleanReturnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole.booleancanManage(org.keycloak.models.ClientModel client) Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole.booleancanManage(org.keycloak.models.ClientScopeModel clientScope) Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole.booleanReturnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole.booleancanMapClientScopeRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_CLIENT_SCOPEfor the client.booleancanMapCompositeRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_COMPOSITE_SCOPEfor the client.booleancanMapRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_SCOPEfor the client.booleancanView()Returnstrueif the caller has at least one of theAdminRoles.MANAGE_CLIENTSorAdminRoles.VIEW_CLIENTSroles.booleancanView(org.keycloak.models.ClientModel client) booleancanView(org.keycloak.models.ClientScopeModel clientScope) Returnstrueif the caller has at least one of theAdminRoles.VIEW_CLIENTSorAdminRoles.MANAGE_CLIENTSroles.booleangetAccess(org.keycloak.models.ClientModel client) getClientIdsByScope(String scope) Returns the IDs of the clients that the current user can perform based onscope.booleanisPermissionsEnabled(org.keycloak.models.ClientModel client) voidrequireConfigure(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanConfigure(ClientModel)returnsfalse.voidThrows ForbiddenException ifcanList()returnsfalse.voidThrows ForbiddenException ifcanListClientScopes()returnsfalse.voidThrows ForbiddenException ifcanManage()returnsfalse.voidrequireManage(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanManage(ClientModel)returnsfalse.voidrequireManage(org.keycloak.models.ClientScopeModel clientScope) Throws ForbiddenException ifcanManage(ClientScopeModel)returnsfalse.voidThrows ForbiddenException ifcanManageClientScopes()returnsfalse.voidvoidrequireView(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanView(ClientModel)returnsfalse.voidrequireView(org.keycloak.models.ClientScopeModel clientScope) Throws ForbiddenException ifcanView(ClientScopeModel)returnsfalse.voidvoidsetPermissionsEnabled(org.keycloak.models.ClientModel client, boolean enable)
-
Method Details
-
isPermissionsEnabled
boolean isPermissionsEnabled(org.keycloak.models.ClientModel client) -
setPermissionsEnabled
void setPermissionsEnabled(org.keycloak.models.ClientModel client, boolean enable) -
requireListClientScopes
void requireListClientScopes()Throws ForbiddenException ifcanListClientScopes()returnsfalse. -
canManage
boolean canManage()Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole. For V2 only: Also if it has permission toAdminPermissionsSchema.MANAGE. -
requireManage
void requireManage()Throws ForbiddenException ifcanManage()returnsfalse. -
canManageClientScopes
boolean canManageClientScopes()Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole. For V2 only: Also if it has permission toAdminPermissionsSchema.MANAGE. -
requireManageClientScopes
void requireManageClientScopes()Throws ForbiddenException ifcanManageClientScopes()returnsfalse. -
canView
boolean canView()Returnstrueif the caller has at least one of theAdminRoles.MANAGE_CLIENTSorAdminRoles.VIEW_CLIENTSroles. For V2 only: Also if it has permission toAdminPermissionsSchema.VIEW. -
canList
boolean canList()ReturnstrueifcanView()returnstrue. Or if the caller has at least one of theAdminRoles.QUERY_CLIENTSrole. V1: orAdminRoles.QUERY_USERSroles. -
canViewClientScopes
boolean canViewClientScopes() -
requireList
void requireList()Throws ForbiddenException ifcanList()returnsfalse. -
canListClientScopes
boolean canListClientScopes() -
requireView
void requireView() -
requireViewClientScopes
void requireViewClientScopes() -
canManage
boolean canManage(org.keycloak.models.ClientModel client) Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole. Or if the caller has a permission toAdminPermissionManagement.MANAGE_SCOPEthe client. For V2 only: Also if the caller has a permission toAdminPermissionsSchema.MANAGEall clients. -
canConfigure
boolean canConfigure(org.keycloak.models.ClientModel client) ReturnstrueifcanManage(ClientModel)returnstrue. Or if the caller has a permission toClientPermissionManagement.CONFIGURE_SCOPEthe client. For V2 only: the call is redirected tocanManage(ClientModel). -
requireConfigure
void requireConfigure(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanConfigure(ClientModel)returnsfalse. For V2 only: the call is redirected torequireManage(ClientModel). -
requireManage
void requireManage(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanManage(ClientModel)returnsfalse. -
canView
boolean canView(org.keycloak.models.ClientModel client) ReturnstrueifcanView()orcanConfigure(ClientModel)returnstrue. Or if the caller has a permission toAdminPermissionManagement.VIEW_SCOPEthe client. For V2 only: Also if the caller has a permission toAdminPermissionsSchema.VIEWall clients. -
requireView
void requireView(org.keycloak.models.ClientModel client) Throws ForbiddenException ifcanView(ClientModel)returnsfalse. -
canManage
boolean canManage(org.keycloak.models.ClientScopeModel clientScope) Returnstrueif the caller hasAdminRoles.MANAGE_CLIENTSrole. For V2 only: Also if it has permission toAdminPermissionsSchema.MANAGE. -
requireManage
void requireManage(org.keycloak.models.ClientScopeModel clientScope) Throws ForbiddenException ifcanManage(ClientScopeModel)returnsfalse. -
canView
boolean canView(org.keycloak.models.ClientScopeModel clientScope) Returnstrueif the caller has at least one of theAdminRoles.VIEW_CLIENTSorAdminRoles.MANAGE_CLIENTSroles. For V2 only: Also if it has permission toAdminPermissionsSchema.VIEW. -
requireView
void requireView(org.keycloak.models.ClientScopeModel clientScope) Throws ForbiddenException ifcanView(ClientScopeModel)returnsfalse. -
canMapRoles
boolean canMapRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_SCOPEfor the client. For V2 only: Also if the caller has a permission toAdminPermissionsSchema.MAP_ROLESfor all clients. -
canMapCompositeRoles
boolean canMapCompositeRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_COMPOSITE_SCOPEfor the client. For V2 only: Also if the caller has a permission toAdminPermissionsSchema.MAP_ROLES_COMPOSITEfor all clients. -
canMapClientScopeRoles
boolean canMapClientScopeRoles(org.keycloak.models.ClientModel client) Returnstrueif the caller has a permission toClientPermissionManagement.MAP_ROLES_CLIENT_SCOPEfor the client. For V2 only: Also if the caller has a permission toAdminPermissionsSchema.MAP_ROLES_CLIENT_SCOPEfor all clients. -
getAccess
-
getClientIdsByScope
Returns the IDs of the clients that the current user can perform based onscope.- Returns:
- Stream of IDs of clients with
scopepermission.
-