Skip to content
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

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

anatol-sialitski
Copy link
Contributor

No description provided.

@anatol-sialitski anatol-sialitski linked an issue Nov 4, 2024 that may be closed by this pull request
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.57%. Comparing base (23b49d1) to head (4ff0579).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...enonic/xp/portal/impl/handler/SlashApiHandler.java 0.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.


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 ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required

}

public boolean isAccessAllowed( final PrincipalKeys principalKeys )
{
return allowedPrincipals == null || principalKeys.contains( RoleKeys.ADMIN ) ||
allowedPrincipals.stream().anyMatch( principalKeys::contains );
return allowedPrincipals.stream().anyMatch( principalKeys::contains );
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@anatol-sialitski anatol-sialitski merged commit b49c4b9 into master Nov 6, 2024
6 checks passed
@anatol-sialitski anatol-sialitski deleted the issue-10755 branch November 6, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApiDescriptor rename slash-api to mount
2 participants