22650aad27
Added Attachments. Added Attachment Media Embeds. Renamed a load of *Store and *Cache methods to reduce the amount of unneccesary typing. Added petabytes as a unit and cleaned up a few of the friendly units. Refactored the username change logic to make it easier to maintain. Refactored the avatar change logic to make it easier to maintain. Shadow now uses CSS Variables for most of it's colours. We have plans to transpile this to support older browsers later on! Snuck some CSS Variables into Tempra Conflux. Added the GroupCache interface to MemoryGroupStore. Added the Length method to MemoryGroupStore. Added support for a site short name. Added the UploadFiles permission. Renamed more functions. Fixed the background for the left gutter on the postbit for Tempra Simple and Shadow. Added support for if statements operating on int8, int16, int32, int32, int64, uint, uint8, uint16, uint32, uint64, float32, and float64 for the template compiler. Added support for if statements operating on slices and maps for the template compiler. Fixed a security exploit in reply editing. Fixed a bug in the URL detector in the parser where it couldn't find URLs with non-standard ports. Fixed buttons having blue outlines on focus on Shadow. Refactored the topic creation logic to make it easier to maintain. Made a few responsive fixes, but there's still more to do in the following commits!
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package main
|
|
|
|
var blankGroup = Group{ID: 0, Name: ""}
|
|
|
|
type GroupAdmin struct {
|
|
ID int
|
|
Name string
|
|
Rank string
|
|
RankClass string
|
|
CanEdit bool
|
|
CanDelete bool
|
|
}
|
|
|
|
// ! Fix the data races
|
|
type Group struct {
|
|
ID int
|
|
Name string
|
|
IsMod bool
|
|
IsAdmin bool
|
|
IsBanned bool
|
|
Tag string
|
|
Perms Perms
|
|
PermissionsText []byte
|
|
PluginPerms map[string]bool // Custom permissions defined by plugins. What if two plugins declare the same permission, but they handle them in incompatible ways? Very unlikely, we probably don't need to worry about this, the plugin authors should be aware of each other to some extent
|
|
PluginPermsText []byte
|
|
Forums []ForumPerms
|
|
CanSee []int // The IDs of the forums this group can see
|
|
}
|
|
|
|
// ! Ahem, don't listen to the comment below. It's not concurrency safe right now.
|
|
// Copy gives you a non-pointer concurrency safe copy of the group
|
|
func (group *Group) Copy() Group {
|
|
return *group
|
|
}
|