Closed mrvahedi68 closed 1 year ago
I did find this: https://github.com/owncloud/core/blob/ab9763b2b4d27a221bf12005eddd2bb7d319d286/lib/private/App/AppManager.php#L227 That might work out-of-the-box on Nextcloud, but not on ownCloud because there we have a switch in config.php that determines whether the server will try to use the app. So if that switch is globally set to true, and the app is then disabled for some users, it would just lead to a 'class not found' error.
So this code works around the 'enabled' column in the oc_appconfig
database table. You can start by adding a JSON-encoded array of group names there, and then calling the isAppEnabledForUser
function inside the SciencemeshShareProviderFactory. You should see that the app is not enabled if the user is not in the group.
Once you have that confirmed on both NC and OC-10 you can add the consequence to that: if the app is not enabled, then just refer to the existing default ShareProviderFactory.
Here's the guide for having this feature on Apps in Nextcloud: You can find it under Settings > apps
And OwnCloud:
Select groups in the administration panel of Siencemesh and enable the app only for users of these groups.