mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-22 18:37:43 +00:00
The previous commit added a data-permission scope to SysApi.Update and returned early on db.Error, which left the RowsAffected check below it unreachable: First reports a row the scope excluded as ErrRecordNotFound, so the caller got "record not found" where the code meant to say "无权更新该数据". Map that one error to the permission message and drop the check it made dead. The two cases - the row does not exist, and the row exists but is not yours - have to look the same from outside, and now do. Found by Copilot's review of #889.