2017-06-12 22:32:27 +02:00
|
|
|
package database
|
|
|
|
|
|
|
|
import "github.com/genofire/logmania/log"
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
Name string
|
|
|
|
Mail string
|
|
|
|
XMPP string
|
|
|
|
NotifyMail bool
|
|
|
|
NotifyXMPP bool
|
|
|
|
NotifyAfterLoglevel log.LogLevel
|
|
|
|
Permissions []Application `gorm:"many2many:user_permissions;"`
|
|
|
|
}
|
2017-06-16 10:33:35 +02:00
|
|
|
|
|
|
|
func UserByApplication(id int) []*User {
|
|
|
|
var users []*User
|
|
|
|
db.Model(&Application{ID: id}).Related(&users)
|
|
|
|
return users
|
|
|
|
}
|