Skip to content

Commit

Permalink
fix(fiat-api): revert breaking change to Permissions. (#492)
Browse files Browse the repository at this point in the history
Deprecates instead of removes isEmpty() on Permissions, and delegates it to check isRestricted
rather than the Map content.
  • Loading branch information
cfieber committed Oct 25, 2019
1 parent 6460ffd commit 161c7b2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ public Set<String> allGroups() {
return permissions.values().stream().flatMap(Collection::stream).collect(Collectors.toSet());
}

/**
* Determines whether this Permissions has any Authorizations with associated roles.
*
* @return whether this Permissions has any Authorizations with associated roles
* @deprecated check {@code !isRestricted()} instead
*/
@Deprecated
public boolean isEmpty() {
return !isRestricted();
}

public boolean isRestricted() {
return this.permissions.values().stream().anyMatch(groups -> !groups.isEmpty());
}
Expand Down

0 comments on commit 161c7b2

Please sign in to comment.