// If the user triggers an error in the access control system, we
// don't want the user to be aware of that, so the user gets the
// same information from the system regardless of if it's an
// internal server error or access denied.
c.JSON(http.StatusForbidden,map[string]string{
"title":"Access denied",// the component needs to pick this up
"message":fmt.Sprintf("Your user account does not have permissions to do the action. We recorded your attempt with log message %s. Contact your administrator for help.",id),
"accessErrorId":id,
})
}
funcnewID()string{
// Less ambiguity than alphanumerical.
numerical:=[]byte("0123456789")
id,err:=util.GetRandomString(10,numerical...)
iferr!=nil{
// this should not happen, but if it does, a timestamp is as