mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Updated visibility levels
This commit is contained in:
		@@ -9,6 +9,15 @@
 | 
			
		||||
 | 
			
		||||
class postsController {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Visibility levels for the API
 | 
			
		||||
	 */
 | 
			
		||||
	const VISIBILITY_LEVELS_API = array(
 | 
			
		||||
		Posts::VISIBILITY_PUBLIC => "public",
 | 
			
		||||
		Posts::VISIBILITY_FRIENDS => "friends",
 | 
			
		||||
		Posts::VISIBILITY_USER => "private"
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Access levels for the POST for the api
 | 
			
		||||
	 */
 | 
			
		||||
@@ -52,6 +61,9 @@ class postsController {
 | 
			
		||||
			//Save level access in the response
 | 
			
		||||
			$posts[$num]["user_access"] = $this::ACCESS_LEVEL_API[$access_level];
 | 
			
		||||
 | 
			
		||||
			//Update visibility level
 | 
			
		||||
			$posts[$num]['visibility_level'] = $this::VISIBILITY_LEVELS_API[$infos['visibility_level']];
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return $posts;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user