Logged in user must be an admin

Hi Everyone,

I am developing an app for the community, and I was going to wait on revealing it until, it was on the app store but while doing some final testing, I’ve seem to have hit a snag to which I cannot find any information on.

The app works as expected as Admin, but when I try to use it as another user I get a “Logged in user must be an admin” error. This is while trying to save the initial configuration of the app in the user settings section. The odd thing is that this error occurs even before the Connect() controller method even fires.

Here is a link to the controller code,

So how do I figure out what the issue is?

Thanks in advance

I guess from your description without looking at the code in depth, that you are missing the annotation@NoAdminRequired. With the more recent Nextcloud core versions, you can use attributes as well. This is a security feature that you must in fact loosen the restrictions. See Controllers — Nextcloud latest Developer Manual latest documentation

1 Like

Hi christianlupus,

Thank you for the quick response!

That was the issue!

After adding @NoAdminRequired to all the methods in the controller class everything is working as it should again!