* @throws NullPointerException if any parameters are {@code null}.
*/
public void setUserPermissions(UserId userId, PermissionsSet permissions) {
PermissionsSet old = user2permissionMap.put(checkNotNull(userId), checkNotNull(permissions));
if(old == null || old.equals(permissions)) {
EventBusManager.getManager().postEvent(new PermissionsChangedEvent(projectId));
}
}