Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15744

Permission Error in eZContentClass::instantiate

    XMLWordPrintable

Details

    Description

      In eZContentClass::instantiate, the function fetch each time the current user regardless if the parameter $userID is set or not. This makes it unusable in login or SSO Handlers, because of fetching the current user before a user is loged in.

      WRONG:

      function instantiate( $userID = false, $sectionID = 0, $versionNumber = false, $languageCode = false, $versionStatus = eZContentObjectVersion::STATUS_INTERNAL_DRAFT )
      {
         $attributes = $this->fetchAttributes();
         $user = eZUser::currentUser();
         if ( $userID === false )
         {
              $userID = $user->attribute( 'contentobject_id' );
         }
      ...
      

      RIGHT:

      function instantiate( $userID = false, $sectionID = 0, $versionNumber = false, $languageCode = false, $versionStatus = eZContentObjectVersion::STATUS_INTERNAL_DRAFT )
      {
         $attributes = $this->fetchAttributes();
         if ( $userID === false )
         {
              $user = eZUser::currentUser();
              $userID = $user->attribute( 'contentobject_id' );
         }
      ...
      

      Attachments

        Activity

          People

            andre1 andre1
            luckylefti luckylefti
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: