@@ -47,6 +47,13 @@ class DAVController extends AbstractController
4747 */
4848 protected $ webDAVEnabled ;
4949
50+ /**
51+ * is Public Calendar enabled?
52+ *
53+ * @var bool
54+ */
55+ protected $ publicCalendarEnabled ;
56+
5057 /**
5158 * Mail address to send mails from.
5259 *
@@ -135,13 +142,14 @@ class DAVController extends AbstractController
135142 */
136143 protected $ server ;
137144
138- public function __construct (MailerInterface $ mailer , BasicAuth $ basicAuthBackend , IMAPAuth $ IMAPAuthBackend , LDAPAuth $ LDAPAuthBackend , UrlGeneratorInterface $ router , EntityManagerInterface $ entityManager , LoggerInterface $ logger , string $ publicDir , bool $ calDAVEnabled = true , bool $ cardDAVEnabled = true , bool $ webDAVEnabled = false , ?string $ inviteAddress = null , ?string $ authMethod = null , ?string $ authRealm = null , ?string $ webdavPublicDir = null , ?string $ webdavHomesDir = null , ?string $ webdavTmpDir = null )
145+ public function __construct (MailerInterface $ mailer , BasicAuth $ basicAuthBackend , IMAPAuth $ IMAPAuthBackend , LDAPAuth $ LDAPAuthBackend , UrlGeneratorInterface $ router , EntityManagerInterface $ entityManager , LoggerInterface $ logger , string $ publicDir , bool $ calDAVEnabled = true , bool $ cardDAVEnabled = true , bool $ webDAVEnabled = false , bool $ publicCalendarEnabled , ?string $ inviteAddress = null , ?string $ authMethod = null , ?string $ authRealm = null , ?string $ webdavPublicDir = null , ?string $ webdavHomesDir = null , ?string $ webdavTmpDir = null )
139146 {
140147 $ this ->publicDir = $ publicDir ;
141148
142149 $ this ->calDAVEnabled = $ calDAVEnabled ;
143150 $ this ->cardDAVEnabled = $ cardDAVEnabled ;
144151 $ this ->webDAVEnabled = $ webDAVEnabled ;
152+ $ this ->publicCalendarEnabled = $ publicCalendarEnabled ;
145153 $ this ->inviteAddress = $ inviteAddress ?? null ;
146154
147155 $ this ->webdavPublicDir = $ webdavPublicDir ;
@@ -230,7 +238,7 @@ private function initServer(string $authMethod, string $authRealm = User::DEFAUL
230238 $ this ->server ->addPlugin (new \Sabre \DAV \Browser \Plugin (false )); // We disable the file creation / upload / sharing in the browser
231239 $ this ->server ->addPlugin (new \Sabre \DAV \Sync \Plugin ());
232240
233- $ aclPlugin = new PublicAwareDAVACLPlugin ($ this ->em );
241+ $ aclPlugin = new PublicAwareDAVACLPlugin ($ this ->em , $ this -> publicCalendarEnabled );
234242 $ aclPlugin ->hideNodesFromListings = true ;
235243
236244 // Fetch admins, if any
0 commit comments