···283283 return bitmap.toScope(), nil
284284}
285285286286+func (s AccessTokenScope) HasPermissionScope() bool {
287287+ return s != "" && s != AccessTokenScopePublicOnly
288288+}
289289+286290// PublicOnly checks if this token scope is limited to public resources
287291func (s AccessTokenScope) PublicOnly() (bool, error) {
288292 bitmap, err := s.parse()
+1-1
models/user/avatar.go
···62626363// AvatarLinkWithSize returns a link to the user's avatar with size. size <= 0 means default size
6464func (u *User) AvatarLinkWithSize(ctx context.Context, size int) string {
6565- if u.IsGhost() {
6565+ if u.IsGhost() || u.ID <= 0 {
6666 return avatars.DefaultAvatarLink()
6767 }
6868