-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApiDescriptor rename slash-api
to mount
#10755
#10756
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10756 +/- ##
=========================================
Coverage 84.57% 84.57%
- Complexity 20012 20013 +1
=========================================
Files 2639 2639
Lines 69437 69438 +1
Branches 5602 5602
=========================================
+ Hits 58724 58726 +2
Misses 8006 8006
+ Partials 2707 2706 -1 ☔ View full report in Codecov by Sentry. |
|
||
private ApiDescriptor( final Builder builder ) | ||
{ | ||
Preconditions.checkNotNull( builder.key, "key cannot be null" ); | ||
|
||
this.key = builder.key; | ||
this.allowedPrincipals = builder.allowedPrincipals; | ||
this.allowedPrincipals = Objects.requireNonNullElseGet( builder.allowedPrincipals, () -> PrincipalKeys.from( RoleKeys.EVERYONE ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required
a9f3a70
to
7d34ac8
Compare
7d34ac8
to
c02dd2e
Compare
modules/core/core-api/src/main/java/com/enonic/xp/api/ApiDescriptor.java
Show resolved
Hide resolved
} | ||
|
||
public boolean isAccessAllowed( final PrincipalKeys principalKeys ) | ||
{ | ||
return allowedPrincipals == null || principalKeys.contains( RoleKeys.ADMIN ) || | ||
allowedPrincipals.stream().anyMatch( principalKeys::contains ); | ||
return allowedPrincipals.stream().anyMatch( principalKeys::contains ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin role should always have access, regardless of what descriptor says
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
c02dd2e
to
9262a9b
Compare
9262a9b
to
4ff0579
Compare
No description provided.