···283 return bitmap.toScope(), nil
284}
2850000286// PublicOnly checks if this token scope is limited to public resources
287func (s AccessTokenScope) PublicOnly() (bool, error) {
288 bitmap, err := s.parse()
···283 return bitmap.toScope(), nil
284}
285286+func (s AccessTokenScope) HasPermissionScope() bool {
287+ return s != "" && s != AccessTokenScopePublicOnly
288+}
289+290// PublicOnly checks if this token scope is limited to public resources
291func (s AccessTokenScope) PublicOnly() (bool, error) {
292 bitmap, err := s.parse()
+1-1
models/user/avatar.go
···6263// AvatarLinkWithSize returns a link to the user's avatar with size. size <= 0 means default size
64func (u *User) AvatarLinkWithSize(ctx context.Context, size int) string {
65- if u.IsGhost() {
66 return avatars.DefaultAvatarLink()
67 }
68
···6263// AvatarLinkWithSize returns a link to the user's avatar with size. size <= 0 means default size
64func (u *User) AvatarLinkWithSize(ctx context.Context, size int) string {
65+ if u.IsGhost() || u.ID <= 0 {
66 return avatars.DefaultAvatarLink()
67 }
68