Skip to content

Commit

Permalink
Don't allow Admin condition rules in Solo/Team
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Mar 27, 2024
1 parent 764e880 commit 0025b42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes for Craft CMS 5

## Unreleased
- Fixed a bug where “Admin” rules were available to user conditions in Solo and Team editions.

## 5.0.0 - 2024-03-26

### Content Management
Expand Down
9 changes: 9 additions & 0 deletions src/elements/conditions/users/AdminConditionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use craft\elements\db\ElementQueryInterface;
use craft\elements\db\UserQuery;
use craft\elements\User;
use craft\enums\CmsEdition;

/**
* Admin condition rule.
Expand All @@ -26,6 +27,14 @@ public function getLabel(): string
return Craft::t('app', 'Admin');
}

/**
* @inheritdoc
*/
public static function isSelectable(): bool
{
return Craft::$app->edition === CmsEdition::Pro;
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit 0025b42

Please sign in to comment.