question

brokenoval avatar image
brokenoval asked brokenoval commented

How can I restrict access to my App to certain user types?

I'd like my app only to be accessible to Managers, Admins and Owners i.e. I would like Employees not to even see the app on their home screens, in the same way that certain Clover apps are only visible to certain employees levels (e.g. "App Market").

Is there a way to do this either in the developer dashboard or in the code?

I have noticed that in Clover's "Employees" app, you can restrict access to apps, but only Clover apps. The best solution would be if we can add our app into this list somehow, set a default in code but allow the merchant to adjust access permissions as they like.

Thanks!

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered brokenoval commented

As you noticed this is possible for Clover applications, but we have not yet exposed that functionality for third party applications.

As a workaround, you can you EmployeeConnector to obtain the Employee object, and call getRole() which returns an AccountRole. This is what we call the "system role"* and will be one of ADMIN, MANAGER, or EMPLOYEE. You can then make decisions in your code based on that.

* Our terminology has been confused here, hence AccountRole vs. Role vs. system role.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brokenoval avatar image brokenoval commented ·

Cheers Jeff - that'll work for the moment I reckon.

0 Likes 0 ·

Welcome to the
Clover Developer Community