Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gazillion101 committed Apr 8, 2023
1 parent fe9769f commit 4f76f50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions web/go/src/authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ func UpdateGroupAssignment(schema string, groups types.GroupAssignment) error {
return nil
}

func CreateNewMapping(schema, dymiumgroup, directorygroup, comments string) error {
func CreateNewMapping(schema, dymiumgroup, directorygroup, comments string, admin bool) error {
// Create a new context, and begin a transaction
ctx, cancelfunc := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelfunc()
Expand All @@ -1661,8 +1661,8 @@ func CreateNewMapping(schema, dymiumgroup, directorygroup, comments string) erro
return err
}

sql := "insert into "+schema+".groupmapping(outergroup, innergroup, comment) values($1, $2, $3) ;"
_, err = tx.ExecContext(ctx, sql, directorygroup, dymiumgroup, comments)
sql := "insert into "+schema+".groupmapping(outergroup, innergroup, comment, adminaccess) values($1, $2, $3, $4) ;"
_, err = tx.ExecContext(ctx, sql, directorygroup, dymiumgroup, comments, admin)

if err != nil {
tx.Rollback()
Expand Down
2 changes: 1 addition & 1 deletion web/go/src/dhandlers/customerhandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ func CreateMapping(w http.ResponseWriter, r *http.Request) {
var t types.GroupMapping
err := json.Unmarshal(body, &t)

error := authentication.CreateNewMapping(schema, t.Dymiumgroup, t.Directorygroup, t.Comments)
error := authentication.CreateNewMapping(schema, t.Dymiumgroup, t.Directorygroup, t.Comments, t.Adminaccess)
var status types.OperationStatus
if(error == nil) {
status = types.OperationStatus{"OK", "Mapping created"}
Expand Down

0 comments on commit 4f76f50

Please sign in to comment.