Skip to content

Providing app blacklist/whitelist functionality in config.php #21566

Closed

Description

@summersab

Is your feature request related to a problem? Please describe.
There are situations where administrators may want to restrict the apps available within their organization.

Describe the solution you'd like
One possible solution would be to add code like this to the fetchApps function in ./apps/settings/lib/Controller/AppSettingsController.php:

$apps_whitelist = $this->config->getSystemValue('apps_whitelist');
if (is_array($apps_whitelist)) {
	$apps = array_filter($apps, function($var) use ($apps_whitelist) {
		return in_array($var['id'], $whitelist);
	});
}

$apps_blacklist = $this->config->getSystemValue('apps_blacklist');
if (is_array($apps_blacklist)) {
	$apps = array_filter($apps, function($var) use ($apps_blacklist) {
		return ! in_array($var['id'], $apps_blacklist);
	});
}

Then, in the config.php file, users could set apps_whitelist and apps_blacklist values.

Describe alternatives you've considered
A better solution would be to provide this functionality to admin users in the UI instead of config.php, but this would be a pretty simple implementation of the basic functionality.

Activity

  1. kesselb commented on Jun 24, 2020

    @kesselb
    Contributor

    And this is good for? Only admins are able to install apps.

  2. summersab commented on Jun 25, 2020

    @summersab
    ContributorAuthor

    I suppose it would be useful for at least two groups of people. If NC is installed for a company, the admins are likely not the people who installed the system nor are they part of the security team. Those other individuals may wish to restrict which apps are permitted based on company policy before turning the NC system over to those who will be admins.

    The second group would be for hosting providers. There are several hosts which restrict which apps are available to their users (sometimes based on their payment tier). This would make it much easier to configure that capability.

  3. olivia-fox commented on Jul 3, 2020

    @olivia-fox

    A similar use case for an app blocklist comes to mind: a company running Nextcloud instances, some of which are resource contained enough (such as by a pricing tier and server RAM) to be unable to stably run Nextcloud Talk. The receiving client/group would need to be unable to install the app with their admin account, to prevent accidentally overloading their instance’s provisioned resources.

  4. kesselb commented on Jul 8, 2020

    @kesselb
    Contributor

    Closing as duplicate of #21057

  5. szaimen commented on Jun 23, 2021

    @szaimen
    Contributor

    Hi summersab, do you mind creating a PR with your patch for further discussion?
    Thank you!

  6. ghost added
    staleTicket or PR with no recent activity
    on Jul 23, 2021
  7. ghost closed this as completedon Aug 6, 2021
  8. kesselb commented on Oct 8, 2021

    @kesselb
    Contributor

    Scheduled for 23: #29135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapenhancementneeds infostaleTicket or PR with no recent activity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions