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

@@ 501-509 (lines=9) @@
498
     *
499
     * @return $this
500
     */
501
    public function setPermissions(PermissionsInterface $permissions)
502
    {
503
        // Assure the user has always all rights.
504
        if ($this->user) {
505
            $permissions->grant($this->user, Permissions::PERMISSION_ALL);
506
        }
507
        $this->permissions = $permissions;
508
509
        return $this;
510
    }
511
512
    /**