Created
October 3, 2011 16:11
-
-
Save rkroll/1259484 to your computer and use it in GitHub Desktop.
createUser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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