コード例 #1
0
  private void authorize(Set<String> roles) {
    boolean hasRoles = identityManagement.hasRoles(roles);

    if (!hasRoles) throw new AeroGearSecurityException(HttpStatus.CREDENTIAL_NOT_AUTHORIZED);
  }
コード例 #2
0
 public SaleAgent register(SaleAgent user) {
   configuration.create(user, null);
   configuration.grant(DEFAULT_ROLE).to(user.getLoginName());
   authenticationManager.login(user, null);
   return user;
 }