feat(36-03): implement pact.HasTokenScopes (sitemap, sitemap:read)

This commit is contained in:
Jakub Zych
2026-11-24 19:57:29 +01:00
parent fdbe593802
commit bd0c813299
5 changed files with 331 additions and 2 deletions

26
token_scopes.go Normal file
View File

@@ -0,0 +1,26 @@
package sitemap
import "git.golem15.com/golem15/summercms/modules/pact"
var _ pact.HasTokenScopes = (*Plugin)(nil)
// TokenScopes registers personal API token scopes for the Sitemap plugin.
func (p *Plugin) TokenScopes() []pact.TokenScope {
all := []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"}
return []pact.TokenScope{
{
Name: "sitemap",
Label: "golem15.sitemap::lang.scopes.sitemap",
Description: "golem15.sitemap::lang.scopes.sitemap_description",
Permissions: []string{"golem15.sitemap.*"},
Methods: all,
},
{
Name: "sitemap:read",
Label: "golem15.sitemap::lang.scopes.sitemap_read",
Description: "golem15.sitemap::lang.scopes.sitemap_read_description",
Permissions: []string{"golem15.sitemap.*"},
Methods: []string{"GET", "HEAD"},
},
}
}