1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-31 22:58:35 +00:00

Add new CLI flags to set name and scopes when creating a user with access token (#34080) (#34103)

Backport #34080

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
This commit is contained in:
wxiaoguang
2025-04-03 01:05:28 +08:00
committed by GitHub
parent 8f75f61b64
commit a40e15a116
4 changed files with 124 additions and 30 deletions

View File

@@ -283,6 +283,10 @@ func (s AccessTokenScope) Normalize() (AccessTokenScope, error) {
return bitmap.toScope(), nil
}
func (s AccessTokenScope) HasPermissionScope() bool {
return s != "" && s != AccessTokenScopePublicOnly
}
// PublicOnly checks if this token scope is limited to public resources
func (s AccessTokenScope) PublicOnly() (bool, error) {
bitmap, err := s.parse()