Github user mitchell852 commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/322#discussion_r103534500
--- Diff: traffic_ops/app/lib/API/User.pm ---
@@ -218,6 +218,118 @@ sub update {
}
+# Create
+sub create {
+ my $self = shift;
+ my $params = $self->req->json;
+
+ if ( !&is_oper($self) ) {
+ return $self->forbidden();
+ }
+
+ my $name = $params->{username};
+ if ( !defined($name) ) {
+ return $self->alert("Username is required.");
+ }
+
+ my $existing = $self->db->resultset('TmUser')->search( { username =>
$name } )->single();
+ if ($existing) {
+ return $self->alert("A user with username \"$name\" already
exists.");
+ }
+
+
+ if ( !defined($params->{fullName}) ) {
+ return $self->alert("full-name is required.");
+ }
+
+ if ( !defined($params->{email}) ) {
+ return $self->alert("email is required.");
+ }
+
+ if ( !defined($params->{localPassword}) ) {
+ return $self->alert("local-password is required.");
+ }
+
+ if ( !defined($params->{confirmLocalPassword}) ) {
+ return $self->alert("confirm-local-password is required.");
+ }
+
+ if ($params->{localPassword} ne $params->{confirmLocalPassword}){
+ return $self->alert("local-password and
confirmed-local-password mismatch.");
+ }
+
+ if ( !defined($params->{role}) ) {
+ return $self->alert("role is required.");
+ }
+
+
+
+ my $values = {
--- End diff --
aren't they supposed to defined the tenantId of the user?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---