File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,10 @@ func (u *User) IsIndividual() bool {
408408	return  u .Type  ==  UserTypeIndividual 
409409}
410410
411+ func  (u  * User ) IsUser () bool  {
412+ 	return  u .Type  ==  UserTypeIndividual  ||  u .Type  ==  UserTypeBot 
413+ }
414+ 
411415// IsBot returns whether or not the user is of type bot 
412416func  (u  * User ) IsBot () bool  {
413417	return  u .Type  ==  UserTypeBot 
Original file line number Diff line number Diff line change @@ -268,12 +268,12 @@ func checkTokenPublicOnly() func(ctx *context.APIContext) {
268268				return 
269269			}
270270		case  auth_model .ContainsCategory (requiredScopeCategories , auth_model .AccessTokenScopeCategoryUser ):
271- 			if  ctx .ContextUser  !=  nil  &&  ! ctx .ContextUser .IsOrganization () &&  ctx .ContextUser .Visibility  !=  api .VisibleTypePublic  {
271+ 			if  ctx .ContextUser  !=  nil  &&  ctx .ContextUser .IsUser () &&  ctx .ContextUser .Visibility  !=  api .VisibleTypePublic  {
272272				ctx .Error (http .StatusForbidden , "reqToken" , "token scope is limited to public users" )
273273				return 
274274			}
275275		case  auth_model .ContainsCategory (requiredScopeCategories , auth_model .AccessTokenScopeCategoryActivityPub ):
276- 			if  ctx .ContextUser  !=  nil  &&  ! ctx .ContextUser .IsOrganization () &&  ctx .ContextUser .Visibility  !=  api .VisibleTypePublic  {
276+ 			if  ctx .ContextUser  !=  nil  &&  ctx .ContextUser .IsUser () &&  ctx .ContextUser .Visibility  !=  api .VisibleTypePublic  {
277277				ctx .Error (http .StatusForbidden , "reqToken" , "token scope is limited to public activitypub" )
278278				return 
279279			}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments