Code Duplication    Length = 9-11 lines in 2 locations

module/Core/src/Core/Entity/FileEntity.php 1 location

@@ 287-297 (lines=11) @@
284
     *
285
     * @return PermissionsInterface
286
     */
287
    public function getPermissions()
288
    {
289
        if (!$this->permissions) {
290
            $perms = new Permissions();
291
            if ($this->user instanceof UserInterface) {
292
                $perms->grant($this->user, PermissionsInterface::PERMISSION_ALL);
293
            }
294
            $this->setPermissions($perms);
295
        }
296
        return $this->permissions;
297
    }
298
    
299
    /**
300
	 * @see \Core\Entity\FileInterface::getUri()

module/Organizations/src/Organizations/Entity/Organization.php 1 location

@@ 458-466 (lines=9) @@
455
     *
456
     * @return $this
457
     */
458
    public function setPermissions(PermissionsInterface $permissions)
459
    {
460
        // Assure the user has always all rights.
461
        if ($this->user) {
462
            $permissions->grant($this->user, Permissions::PERMISSION_ALL);
463
        }
464
        $this->permissions = $permissions;
465
466
        return $this;
467
    }
468
469
    /**