nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.17k stars 4.04k forks source link

Allow public page access to apps with group restrictions on #5309

Open pranavk opened 7 years ago

pranavk commented 7 years ago

Currently, when group restrictions are on, it is not possible to have a controller method declared as public page because the security middleware checks if the app is enabled for the user unconditionally.

See: https://github.com/nextcloud/server/blob/master/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php#L188

Although, when group restrictions are disabled, then \OC_App::isEnabled($this->appName) returns true making it possible to access a public controller method.

However, an app might need to make a method public even when group restrictions are on. My use case is nextcloud/richdocuments where the document editing service requires to download the document from nextcloud to be able to edit it. Since it has no user context, it downloads the file (and does some other stuff too) via a public controller method, which fails when group restrictions are on.

I think we may need to introduce a new annotation here and then guard the security middleware method there with it.

julien-nc commented 6 years ago

Did you find a solution ? I'm looking for a way to allow public pages to my apps (PhoneTrack and GpxPod) when they are group restrictions...

julien-nc commented 6 years ago

There is a duplicate of this issue : #6962

julien-nc commented 6 years ago

8593 partially fixes the problem : Routing system is still redirecting users who are not in any authorized group when they try to access to public pages of restricted apps. I'll try to find where to fix that.

szaimen commented 3 years ago

I suppose this issue is still valid? If not, please close this issue!