Reputation: 3301
We created an application for Google Apps, and we use the "Integrate with Google" button [ https://developers.google.com/apps-marketplace/button ]. The problem is that the user who clicks on this button has to be an admin, and the user doesn't receive any error message if he is not an admin (but nothing happens). We wrote on the page with the button that the user has to be an admin, but we want to display error messages to users who are not admins who click on this button. How can we display a message to such a user? I didn't find anything related in the documentation.
This is the HTML code that inserts this button:
<div class="integrate-with-google"><div class="g-additnow" data-applicationid="{{ application_id }}"><img id="g" src="[removed]" alt="Install">Click to add [application name] (sign in as admin of your domain)</div><script src="https://apis.google.com/js/platform.js"></script></div>
By the way, if it's possible to check if the user is an admin or not before displaying the button, then we can display a different message to users who are not admins and display the "Integrate with Google" button only to users who are admins of their domain in Google Apps.
Our application is based on Google App Engine and Python.
Update: I found out that Google displays messages to admins and non-admins who click on this button, but they were not visible because we had other elements with high z-index. But if it's possible to know if the user is not an admin before clicking this button, it's better and then we can display a different message to non-admins without the button (they see an error message when they click on the button).
Upvotes: 1
Views: 189
Reputation: 1120
Depending on the needs of your application, you could check for isAdmin
or isDelegatedAdmin
with the Directory API. For example, if your app requires super admin access, you'll want isAdmin
.
Upvotes: 2