'Raises a PopupException if permission is denied.
Either perm or both app and action are required.'

def check_hue_permission(self, perm=None, app=None, action=None):

    if (perm is None):
        perm = self._lookup_permission(app, action)
    if self.has_hue_permission(perm):
        return
    else:
        raise PopupException((_t('You    do    not    have    permissions    to    %(description)s.') % dict(description=perm.description)))
