src/Entity/Permissions.php
protected function getResourceId($resource)
    {
        if ($resource instanceof PermissionsResourceInterface) {
            return $resource->getPermissionsResourceId();
        }
        
        if ($resource instanceof UserInterface) {
            return 'user:' . $resource->getId();
        }
        
        return 'user:' . $resource;
    }
protected function getResourceId($resource)
    {
        if ($resource instanceof PermissionsResourceInterface) {
            return $resource->getPermissionsResourceId();
        }
        
        if ($resource instanceof UserInterface) {
            return 'user:' . $resource->getId();
        }
        
        return 'user:' . $resource;
    }
Gets/Generates the resource id.

@param string|UserInterface|PermissionsResourceInterface $resource

@return string