public function updatePostPermissions() {
		$set = $this->owner->PostPermission;
		$source = $this->postPermissionSource();
		
		switch ($set) {
			case 'Hidden': {
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FRIENDS));

				$source->InheritPerms = false;
				$source->PublicAccess = false;
				break;
			}
			case 'Friends only': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;
				
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}
			
			case 'Friends and followers': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;

				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}
			
			case 'Logged In': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;

				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}

			case 'Public': {
				$source->PublicAccess = true;
				break;
			}
		}
		
		$source->write();
	}
public function updatePostPermissions() {
		$set = $this->owner->PostPermission;
		$source = $this->postPermissionSource();
		
		switch ($set) {
			case 'Hidden': {
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FRIENDS));

				$source->InheritPerms = false;
				$source->PublicAccess = false;
				break;
			}
			case 'Friends only': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;
				
				$this->permissionService->removePermissions($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}
			
			case 'Friends and followers': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;

				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}
			
			case 'Logged In': {
				$source->InheritPerms = false;
				$source->PublicAccess = false;

				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FOLLOWERS));
				$this->permissionService->grant($source, 'View', $this->getGroupFor(self::FRIENDS));
				break;
			}

			case 'Public': {
				$source->PublicAccess = true;
				break;
			}
		}
		
		$source->write();
	}
public function updatePostPermissions ( ) { $ set = $ this -> owner -> PostPermission ; $ source = $ this -> postPermissionSource ( ) ; switch ( $ set ) { case 'Hidden' : { $ this -> permissionService -> removePermissions ( $ source , 'View' , $ this -> getGroupFor ( self :: FOLLOWERS ) ) ; $ this -> permissionService -> removePermissions ( $ source , 'View' , $ this -> getGroupFor ( self :: FRIENDS ) ) ; $ source -> InheritPerms = false ; $ source -> PublicAccess = false ; break ; } case 'Friends only' : { $ source -> InheritPerms = false ; $ source -> PublicAccess = false ; $ this -> permissionService -> removePermissions ( $ source , 'View' , $ this -> getGroupFor ( self :: FOLLOWERS ) ) ; $ this -> permissionService -> grant ( $ source , 'View' , $ this -> getGroupFor ( self :: FRIENDS ) ) ; break ; } case 'Friends and followers' : { $ source -> InheritPerms = false ; $ source -> PublicAccess = false ; $ this -> permissionService -> grant ( $ source , 'View' , $ this -> getGroupFor ( self :: FOLLOWERS ) ) ; $ this -> permissionService -> grant ( $ source , 'View' , $ this -> getGroupFor ( self :: FRIENDS ) ) ; break ; } case 'Logged In' : { $ source -> InheritPerms = false ; $ source -> PublicAccess = false ; $ this -> permissionService -> grant ( $ source , 'View' , $ this -> getGroupFor ( self :: FOLLOWERS ) ) ; $ this -> permissionService -> grant ( $ source , 'View' , $ this -> getGroupFor ( self :: FRIENDS ) ) ; break ; } case 'Public' : { $ source -> PublicAccess = true ; break ; } } $ source -> write ( ) ; }
set permissions for this user's posts
set permissions for this user s posts