go1.16 and embed
This commit is contained in:
parent
0a55030ae5
commit
82fd34b288
42 changed files with 95 additions and 1236 deletions
|
|
@ -28,6 +28,7 @@ var reservedURIs = []string{
|
|||
core.UsersURI,
|
||||
core.UserURI,
|
||||
core.ViewURI,
|
||||
core.StaticURI,
|
||||
}
|
||||
|
||||
var reservedNames []string
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ func (db *DB) SectionExists(section string) error {
|
|||
|
||||
func (db *DB) CreateSection(section string, members []string, user bool) error {
|
||||
section = userRe.ReplaceAllString(section, "")
|
||||
if _, ok := core.Contains(section, reservedNames); ok {
|
||||
return fmt.Errorf("%s: %s", errNameReserved, section)
|
||||
}
|
||||
if err := db.SectionExists(section); err == nil {
|
||||
return errSectionExists
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue