public boolean hasPermission ( final ApiKey apiKey , String permissionName ) { if ( apiKey . getTeams ( ) == null ) { return false ; } for ( final Team team : apiKey . getTeams ( ) ) { final List < Permission > teamPermissions = getObjectById ( Team . class , team . getId ( ) ) . getPermissions ( ) ; for ( final Permission permission : teamPermissions ) { if ( permission . getName ( ) . equals ( permissionName ) ) { return true ; } } } return false ; }
Determines if the specified ApiKey has been assigned the specified permission .