Check if app is enabled for user

Fixes https://github.com/owncloud/core/issues/12188 for AppFramework apps
(Yes - I know - no DI and so on. But @icewind1991 is working on DI for that whole app class)

@karlitschek Needs a backport. Security relevant.

@icewind1991 @Raydiation Please review.