mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 00:11:04 +00:00 
			
		
		
		
	Backport of #21849
This commit is contained in:
		
					parent
					
						
							
								ef08998bf6
							
						
					
				
			
			
				commit
				
					
						b2369830bb
					
				
			
		
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -458,8 +458,9 @@ func CountOrgs(opts FindOrgOptions) (int64, error) {
 | 
			
		|||
 | 
			
		||||
// HasOrgOrUserVisible tells if the given user can see the given org or user
 | 
			
		||||
func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool {
 | 
			
		||||
	// Not SignedUser
 | 
			
		||||
	if user == nil {
 | 
			
		||||
	// If user is nil, it's an anonymous user/request.
 | 
			
		||||
	// The Ghost user is handled like an anonymous user.
 | 
			
		||||
	if user == nil || user.IsGhost() {
 | 
			
		||||
		return orgOrUser.Visibility == structs.VisibleTypePublic
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue