Skip to content

Commit

Permalink
Fix deleted scope visibility (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Conaway <[email protected]>
  • Loading branch information
hellifiknow and jeffp42 authored Sep 12, 2024
1 parent e8d80f1 commit 90399a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Backend/View/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function getCollection(QueryFilter $filter, ContextInterface $context)
$condition = $filter->getCondition([QueryFilter::COLUMN_SEARCH => Table\Generated\ScopeTable::COLUMN_NAME]);
$condition->equals(Table\Generated\ScopeTable::COLUMN_TENANT_ID, $context->getTenantId());
$condition->equals(Table\Generated\ScopeTable::COLUMN_CATEGORY_ID, $context->getUser()->getCategoryId());
$condition->equals(Table\Generated\ScopeTable::COLUMN_STATUS, Table\Scope::STATUS_ACTIVE);

$builder = new Builder($this->connection);

Expand Down
2 changes: 2 additions & 0 deletions src/Consumer/View/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function getCollection(QueryFilter $filter, ContextInterface $context)
$condition->equals('user_scope.' . Table\Generated\UserScopeTable::COLUMN_USER_ID, $context->getUser()->getId());
$condition->equals('scope.' . Table\Generated\ScopeTable::COLUMN_TENANT_ID, $context->getTenantId());
$condition->equals('scope.' . Table\Generated\ScopeTable::COLUMN_CATEGORY_ID, $context->getUser()->getCategoryId());
$condition->equals(Table\Generated\ScopeTable::COLUMN_STATUS, Table\Scope::STATUS_ACTIVE);


$queryBuilder = $this->connection->createQueryBuilder()
->select([
Expand Down
2 changes: 2 additions & 0 deletions src/Table/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function getValidScopes(?string $tenantId, array $names): array
$condition = Condition::withAnd();
$condition->equals(self::COLUMN_TENANT_ID, $tenantId);
$condition->in(self::COLUMN_NAME, $names);
$condition->equals(self::COLUMN_STATUS, self::STATUS_ACTIVE);
return $this->findAll($condition, 0, 1024);
} else {
return [];
Expand All @@ -126,6 +127,7 @@ public function getAvailableScopes(int $categoryId, ?string $tenantId = null): a
$condition = Condition::withAnd();
$condition->equals(self::COLUMN_TENANT_ID, $tenantId);
$condition->equals(self::COLUMN_CATEGORY_ID, $categoryId);
$condition->equals(self::COLUMN_STATUS, self::STATUS_ACTIVE);

$result = $this->findAll($condition, 0, 1024, self::COLUMN_NAME, OrderBy::ASC);
$scopes = [];
Expand Down

0 comments on commit 90399a1

Please sign in to comment.