Check if app is enabled for user

Fixes https://github.com/owncloud/core/issues/12188 for AppFramework apps
Merge branch 'stable7-upstream' into stable7-rotdrop

Conflicts:
	tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
Update.
Update