Pārlūkot izejas kodu

FD3-721 Se agrega hasIntercom a los datos del usuario.

Maximiliano Schvindt 6 gadi atpakaļ
vecāks
revīzija
5aeb06e91c

+ 9 - 0
OAuth/Response/PathUserResponse.php

@@ -19,6 +19,7 @@ class PathUserResponse extends \HWI\Bundle\OAuthBundle\OAuth\Response\PathUserRe
         'roles' => null,
         'tenancies' => null,
         'tenancyCurrent' => null,
+        'hasIntercom' => null,
     );
 
     /**
@@ -44,5 +45,13 @@ class PathUserResponse extends \HWI\Bundle\OAuthBundle\OAuth\Response\PathUserRe
     {
         return $this->getValueForPath('tenancyCurrent');
     }
+    
+    /**
+     * {@inheritdoc}
+     */
+    public function getHasIntercom()
+    {
+        return $this->getValueForPath('hasIntercom');
+    }
 
 }

+ 1 - 0
Resources/config/hwioauthbundle/config.yml

@@ -18,6 +18,7 @@ hwi_oauth:
                 roles: roles
                 tenancies: tenancies
                 tenancyCurrent: tenancyCurrent
+                hasIntercom: hasIntercom
     firewall_names: [secured_area]
 
 doctrine:

+ 24 - 0
Security/Core/User/CustomOAuthUser.php

@@ -70,5 +70,29 @@ class CustomOAuthUser extends OAuthUser
     {
         $this->tenancyCurrent = $tenancyCurrent;
     }
+    
+    /**
+     * @param boolean $hasIntercom
+     */
+    public function setHasIntercom($hasIntercom)
+    {
+        $this->hasIntercom = $hasIntercom;
+    }
+    
+    /**
+     * @return boolean
+     */
+    public function getHasIntercom()
+    {
+        return $this->hasIntercom;
+    }
+    
+    /**
+     * @return boolean
+     */
+    public function hasIntercom() 
+    {
+        return $this->hasIntercom;
+    }
 
 }

+ 1 - 0
Security/Core/User/CustomOAuthUserProvider.php

@@ -54,6 +54,7 @@ class CustomOAuthUserProvider extends OAuthUserProvider
         $user->setRoles($response->getRoles());
         $user->setTenancies($response->getTenancies());
         $user->setTenancyCurrent($response->getTenancyCurrent());
+        $user->setHasIntercom($response->getHasIntercom());
         $token = new UsernamePasswordToken($user, null, "secured_area", $user->getRoles());
         $this->securityTokenStorage->setToken($token);