mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: add response to Records page (#2830)
* feat: add response to Records page * feat: improve AddRecord * feat: remove log and return err * feat: improve record in signup and record deny * fix: filter will generate 403 record correctly
This commit is contained in:
@ -60,12 +60,30 @@ func RecordMessage(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
record := object.NewRecord(ctx)
|
||||
|
||||
userId := getUser(ctx)
|
||||
|
||||
ctx.Input.SetParam("recordUserId", userId)
|
||||
}
|
||||
|
||||
func AfterRecordMessage(ctx *context.Context) {
|
||||
record, err := object.NewRecord(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
userId := ctx.Input.Params()["recordUserId"]
|
||||
if userId != "" {
|
||||
record.Organization, record.User = util.GetOwnerAndNameFromId(userId)
|
||||
}
|
||||
|
||||
util.SafeGoroutine(func() { object.AddRecord(record) })
|
||||
recordSignup := ctx.Input.Params()["recordSignup"]
|
||||
if recordSignup == "true" {
|
||||
record2 := *record
|
||||
record2.Action = "signup"
|
||||
util.SafeGoroutine(func() { object.AddRecord(&record2) })
|
||||
}
|
||||
|
||||
util.SafeGoroutine(func() {
|
||||
object.AddRecord(record)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user