Skip to content

Public capabilities API - #5567

Merged
rullzer merged 5 commits into
masterfrom
public-capabilities
Jul 12, 2017
Merged

rullzer merged 5 commits into
masterfrom
public-capabilities

Conversation

@juliusknorr

Copy link
Copy Markdown
Member

This PR allows apps to expose capabilities to unauthenticated users as proposed in #4510.

Apps can make use of this by implementing IPublicCapability instead of ICapability.

The second commit will expose theming values to public to allow clients to obtain those values even before login.

Comment thread lib/private/CapabilitiesManager.php Outdated

if ($c instanceof ICapability) {
$capabilities = array_replace_recursive($capabilities, $c->getCapabilities());
if(!$public || ($public && $c instanceof IPublicCapability)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove ($public && it's not needed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. Fixed.

@codecov

codecov Bot commented Jun 30, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #5567 into master will decrease coverage by <.01%.
The diff coverage is 85.71%.

@@             Coverage Diff              @@
##             master    #5567      +/-   ##
============================================
- Coverage     53.98%   53.98%   -0.01%     
- Complexity    22466    22469       +3     
============================================
  Files          1390     1390              
  Lines         85980    85984       +4     
  Branches       1329     1329              
============================================
+ Hits          46418    46419       +1     
- Misses        39562    39565       +3
Impacted Files Coverage Δ Complexity Δ
apps/theming/lib/Capabilities.php 77.77% <ø> (ø) 3 <0> (ø) ⬇️
lib/private/CapabilitiesManager.php 100% <100%> (ø) 8 <6> (+2) ⬆️
core/Controller/OCSController.php 77.77% <75%> (-0.66%) 10 <0> (+1)
apps/comments/lib/EventHandler.php 79.16% <0%> (-8.34%) 7% <0%> (ø)
lib/private/Server.php 93.36% <0%> (-0.15%) 120% <0%> (ø)
lib/private/Security/CertificateManager.php 91.83% <0%> (+1.02%) 39% <0%> (ø) ⬇️

@MorrisJobke MorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and works 👍

@MorrisJobke

Copy link
Copy Markdown
Member

It should also be added to https://lukasreschke.github.io/OpenCloudMeshSpecification/ then ;)

Signed-off-by: Morris Jobke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants