Skip to content

Extract caldav sharing stuff from publishing stuff - #34873

Open
tcitworld wants to merge 1 commit into
masterfrom
extract-caldav-sharing-plugin
Open

Extract caldav sharing stuff from publishing stuff#34873
tcitworld wants to merge 1 commit into
masterfrom
extract-caldav-sharing-plugin

Conversation

@tcitworld

Copy link
Copy Markdown
Member

Based on and replaces #34372 by @pboguslawski

The publishing plugin handled both doing the actual publishing/unpublishing as well as exposing the supported sharing features.

Now we have one for each use and publishing can be properly disabled. The CalDAVSharingPlugin will probably be useful for most of the issues in #20096 anyway.

* @var IConfig
*/
protected $config;
protected Server $server;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\DAV\CalDAV\Publishing\PublishPlugin::$server is not defined in constructor of OCA\DAV\CalDAV\Publishing\PublishPlugin or in any methods called in the constructor
class SharingPlugin extends ServerPlugin {
public const NS_CALENDARSERVER = 'http://calendarserver.org/ns/';

protected Server $server;

Check notice

Code scanning / Psalm

PropertyNotSetInConstructor

Property OCA\DAV\CalDAV\SharingPlugin::$server is not defined in constructor of OCA\DAV\CalDAV\SharingPlugin or in any methods called in the constructor
*
* @param Server $server
*/
public function initialize(Server $server) {

Check notice

Code scanning / Psalm

MissingReturnType

Method OCA\DAV\CalDAV\SharingPlugin::initialize does not have a return type, expecting void
$this->server->on('propFind', [$this, 'propFind']);
}

public function propFind(PropFind $propFind, INode $node) {

Check notice

Code scanning / Psalm

MissingReturnType

Method OCA\DAV\CalDAV\SharingPlugin::propFind does not have a return type, expecting void
@pboguslawski

Copy link
Copy Markdown
Contributor

Didn't notice any problems after applying this patch on 24.0.5. Thank you!

@miaulalalamiaulalala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • no value set - public share links work and is an option in calendar
  • value set to yes - public share link works and is an option in calendar
  • value set to no - public share link does not work and there is not an option to create a public share link in calendar but sharing with users and groups still works

Comment threadapps/dav/composer/autoload.php Outdated
@tcitworld
tcitworldforce-pushed the extract-caldav-sharing-plugin branch from 4fd3cba to 7f87ac8CompareJanuary 20, 2023 14:12
@ChristophWurst

Copy link
Copy Markdown
Member

Now we have one for each use and publishing can be properly disabled. The CalDAVSharingPlugin will probably be useful for most of the issues in #20096 anyway.

🙌 🙌

@ChristophWurstChristophWurst 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.

Should we add tests?

@tcitworld

tcitworld commented Jan 20, 2023

Copy link
Copy Markdown
MemberAuthor

Due to the callbacks, Sabre patterns are hard to test, there would be low value for added tests here. Not sure if it's impossible, but it's never been done before in all other plugins.

@pboguslawski

pboguslawski commented Jan 30, 2023

Copy link
Copy Markdown
Contributor

After upgrading to server 25.0.3 with this mod applied + calendar 4.2.1, when shareapi_allow_links is disabled...

# /usr/bin/php /var/www/nextcloud/occ config:app:set core shareapi_allow_links --value='no'
Config value shareapi_allow_links for app core set to no
# /usr/bin/php /var/www/nextcloud/occ config:app:get core shareapi_allow_links
no

...then Edit calendar dialog still contains Share link with + but clicking + displays popup with An error occurred, unable to publish calendar. (POST with 501 Not Implemented in browser dev tools).

After enabling...

# /usr/bin/php /var/www/nextcloud/occ config:app:set core shareapi_allow_links --value='yes'
Config value shareapi_allow_links for app core set to yes
# /usr/bin/php /var/www/nextcloud/occ config:app:get core shareapi_allow_links
yes

...clicking + works ok.

Seems that server blocks sharing via link correctly but calendar app after upgrade should have Share link removed in Edit calendar when shareapi_allow_links is disabled.

@blizzzblizzz mentioned this pull request Feb 1, 2023
@skjnldsvskjnldsv mentioned this pull request Feb 23, 2023
@blizzzblizzz mentioned this pull request Mar 7, 2023
@blizzzblizzz modified the milestones: Nextcloud 26, Nextcloud 27Mar 9, 2023
@szaimen

Copy link
Copy Markdown
Contributor

@tcitworld can you please fix the conflicts and the tests? Thanks in advance! :)

@szaimenszaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 17, 2023
This was referenced May 3, 2023
@blizzzblizzz mentioned this pull request May 17, 2023
@blizzzblizzz modified the milestones: Nextcloud 27, Nextcloud 28May 23, 2023
@skjnldsvskjnldsv mentioned this pull request Nov 1, 2023
@blizzzblizzz mentioned this pull request Nov 6, 2023
This was referenced Jan 14, 2026
@nextcloud-botnextcloud-bot mentioned this pull request Jan 22, 2026
This was referenced Jan 29, 2026
This was referenced Feb 11, 2026
@blizzzblizzz modified the milestones: Nextcloud 33, Nextcloud 34Feb 16, 2026
@DorraJaouad
DorraJaouad requested a review from a team as a code ownerApril 23, 2026 09:41
@DorraJaouad
DorraJaouad requested review from ArtificialOwl, CarlSchwan, come-nc and icewind1991 and removed request for a teamApril 23, 2026 09:41
@nextcloud-botnextcloud-bot mentioned this pull request May 27, 2026
@nextcloud-botnextcloud-bot mentioned this pull request Jun 4, 2026
This was referenced Jun 5, 2026
@susnuxsusnux added the community pull requests from community label Jun 9, 2026
@susnuxsusnux removed this from the Nextcloud 34.0.1 milestone Jun 9, 2026
@provokateurin

Copy link
Copy Markdown
Member

Hey @tcitworld could you try doing another rebase, so we can finally get this merged?

@provokateurinprovokateurin self-assigned this Jun 11, 2026
So that it's still there when we disable the PublishPlugin
And disable sharing calendars via link when sharik via link is disabled
This mod disallows sharing calendars via link when `shareapi_allow_links`
is disabled.
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Carl Schwan <carlschwan@kde.org>
Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
@CarlSchwan
CarlSchwanforce-pushed the extract-caldav-sharing-plugin branch from 7f87ac8 to 66b7f2eCompareJune 11, 2026 08:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progresscommunitypull requests from communityfeature: caldavRelated to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

14 participants

@tcitworld@pboguslawski@ChristophWurst@szaimen@SebastianKrupinski@provokateurin@miaulalala@github-advanced-security@joshtrichards@susnux@blizzz@skjnldsv@nextcloud-bot@CarlSchwan