mirror of
https://github.com/shlinkio/shlink.git
synced 2026-08-13 06:24:44 -05:00
Added roles info to api key generation and api key list
This commit is contained in:
@@ -72,12 +72,12 @@ class DomainRepositoryTest extends DatabaseTestCase
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
$authorAndDomainApiKey->registerRole(RoleDefinition::forDomain($fooDomain->getId()));
|
||||
$authorAndDomainApiKey->registerRole(RoleDefinition::forDomain($fooDomain));
|
||||
|
||||
$fooDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($fooDomain->getId()));
|
||||
$fooDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($fooDomain));
|
||||
$this->getEntityManager()->persist($fooDomainApiKey);
|
||||
|
||||
$barDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($barDomain->getId()));
|
||||
$barDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($barDomain));
|
||||
$this->getEntityManager()->persist($fooDomainApiKey);
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
@@ -335,9 +335,9 @@ class ShortUrlRepositoryTest extends DatabaseTestCase
|
||||
$this->getEntityManager()->persist($apiKey);
|
||||
$otherApiKey = ApiKey::withRoles(RoleDefinition::forAuthoredShortUrls());
|
||||
$this->getEntityManager()->persist($otherApiKey);
|
||||
$wrongDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($wrongDomain->getId()));
|
||||
$wrongDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($wrongDomain));
|
||||
$this->getEntityManager()->persist($wrongDomainApiKey);
|
||||
$rightDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($rightDomain->getId()));
|
||||
$rightDomainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($rightDomain));
|
||||
$this->getEntityManager()->persist($rightDomainApiKey);
|
||||
|
||||
$shortUrl = new ShortUrl('foo', ShortUrlMeta::fromRawData(
|
||||
|
||||
@@ -114,7 +114,7 @@ class TagRepositoryTest extends DatabaseTestCase
|
||||
|
||||
$authorApiKey = ApiKey::withRoles(RoleDefinition::forAuthoredShortUrls());
|
||||
$this->getEntityManager()->persist($authorApiKey);
|
||||
$domainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($domain->getId()));
|
||||
$domainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($domain));
|
||||
$this->getEntityManager()->persist($domainApiKey);
|
||||
|
||||
$names = ['foo', 'bar', 'baz', 'another'];
|
||||
|
||||
@@ -221,7 +221,7 @@ class VisitRepositoryTest extends DatabaseTestCase
|
||||
$this->getEntityManager()->persist($shortUrl3);
|
||||
$this->createVisitsForShortUrl($shortUrl3, 7);
|
||||
|
||||
$domainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($domain->getId()));
|
||||
$domainApiKey = ApiKey::withRoles(RoleDefinition::forDomain($domain));
|
||||
$this->getEntityManager()->persist($domainApiKey);
|
||||
|
||||
$this->getEntityManager()->flush();
|
||||
|
||||
Reference in New Issue
Block a user