Code Duplication    Length = 9-11 lines in 2 locations

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

@@ 336-344 (lines=9) @@
333
     *
334
     * @return $this
335
     */
336
    public function setPermissions(PermissionsInterface $permissions)
337
    {
338
        // Assure the user has always all rights.
339
        if ($this->user) {
340
            $permissions->grant($this->user, Permissions::PERMISSION_ALL);
341
        }
342
        $this->permissions = $permissions;
343
        return $this;
344
    }
345
346
    /**
347
     * Gets the Permissions Resource ID

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

@@ 282-292 (lines=11) @@
279
     *
280
     * @return PermissionsInterface
281
     */
282
    public function getPermissions()
283
    {
284
        if (!$this->permissions) {
285
            $perms = new Permissions();
286
            if ($this->user instanceof UserInterface) {
287
                $perms->grant($this->user, PermissionsInterface::PERMISSION_ALL);
288
            }
289
            $this->setPermissions($perms);
290
        }
291
        return $this->permissions;
292
    }
293
}