Skip to content

Instantly share code, notes, and snippets.

@rkroll
Created October 3, 2011 16:11
Show Gist options
  • Save rkroll/1259484 to your computer and use it in GitHub Desktop.
Save rkroll/1259484 to your computer and use it in GitHub Desktop.
createUser
public User createUser(Account account, User user) {
account.addUser(user);
save(account);
//TODO - announce UserCreatedEvent
//TODO - move to listener
ObjectIdentity oid = new ObjectIdentityImpl(account);
securityService.createPermission(oid, new PrincipalSid(user.getUsername()), BasePermission.READ);
return user;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment