public function update($request, $match)
    {
        $currentUser = $request->user;
        $user = Pluf_Shortcuts_GetObjectOr404('User', $match['userId']);
        if($currentUser->getId() === $user->getId() || User_Precondition::ownerRequired($request)){
            $profileDoc = User_Views_CProfile::get_profile_document($user->id);
            User_Views_CProfile::putDocumentMap($profileDoc, $request->REQUEST);
            $docMap = User_Views_CProfile::getDocumentMap($profileDoc);
            $docMap['user'] = $user->id;
            return new Pluf_HTTP_Response_Json($docMap);
        }
        throw new Pluf_Exception_PermissionDenied("Permission is denied");
    }
public function update($request, $match)
    {
        $currentUser = $request->user;
        $user = Pluf_Shortcuts_GetObjectOr404('User', $match['userId']);
        if($currentUser->getId() === $user->getId() || User_Precondition::ownerRequired($request)){
            $profileDoc = User_Views_CProfile::get_profile_document($user->id);
            User_Views_CProfile::putDocumentMap($profileDoc, $request->REQUEST);
            $docMap = User_Views_CProfile::getDocumentMap($profileDoc);
            $docMap['user'] = $user->id;
            return new Pluf_HTTP_Response_Json($docMap);
        }
        throw new Pluf_Exception_PermissionDenied("Permission is denied");
    }
public function update ( $ request , $ match ) { $ currentUser = $ request -> user ; $ user = Pluf_Shortcuts_GetObjectOr404 ( 'User' , $ match [ 'userId' ] ) ; if ( $ currentUser -> getId ( ) === $ user -> getId ( ) || User_Precondition :: ownerRequired ( $ request ) ) { $ profileDoc = User_Views_CProfile :: get_profile_document ( $ user -> id ) ; User_Views_CProfile :: putDocumentMap ( $ profileDoc , $ request -> REQUEST ) ; $ docMap = User_Views_CProfile :: getDocumentMap ( $ profileDoc ) ; $ docMap [ 'user' ] = $ user -> id ; return new Pluf_HTTP_Response_Json ( $ docMap ) ; } throw new Pluf_Exception_PermissionDenied ( "Permission is denied" ) ; }
Update profile of specified user.

@param Pluf_HTTP_Request $request
@param array $match
@param array $p
@throws Pluf_Exception
@return Pluf_HTTP_Response_Json
Update profile of specified user .