Feat: get policy from directory props / Feat: return source enabled flag in file list
This commit is contained in:
@@ -27,7 +27,6 @@ type User struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
PreferredTheme string `json:"preferred_theme"`
|
||||
Anonymous bool `json:"anonymous"`
|
||||
Policy policy `json:"policy"`
|
||||
Group group `json:"group"`
|
||||
Tags []tag `json:"tags"`
|
||||
}
|
||||
@@ -98,13 +97,6 @@ func BuildUser(user model.User) User {
|
||||
CreatedAt: user.CreatedAt,
|
||||
PreferredTheme: user.OptionsSerialized.PreferredTheme,
|
||||
Anonymous: user.IsAnonymous(),
|
||||
Policy: policy{
|
||||
SaveType: user.Policy.Type,
|
||||
MaxSize: fmt.Sprintf("%.2fmb", float64(user.Policy.MaxSize)/(1024*1024)),
|
||||
AllowedType: user.Policy.OptionsSerialized.FileType,
|
||||
UploadURL: user.Policy.GetUploadURL(),
|
||||
AllowGetSource: user.Policy.IsOriginLinkEnable,
|
||||
},
|
||||
Group: group{
|
||||
ID: user.GroupID,
|
||||
Name: user.Group.Name,
|
||||
|
||||
Reference in New Issue
Block a user