Cleanup logging. Readinging implies being able to subscribe.
This commit is contained in:
parent
6fd307cf88
commit
fb34bc2e19
|
|
@ -1,4 +1,4 @@
|
||||||
j7s-mosquitto-plugin (0.0.3-1) unstable; urgency=medium
|
j7s-mosquitto-plugin (0.0.6-1) unstable; urgency=medium
|
||||||
|
|
||||||
* Load multiple keys per user.
|
* Load multiple keys per user.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,24 +158,18 @@ int j7s_acl_check_callback(int event, void *event_data, void *userdata)
|
||||||
return MOSQ_ERR_PLUGIN_DEFER;
|
return MOSQ_ERR_PLUGIN_DEFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
switch (acl_data->access)
|
switch (acl_data->access)
|
||||||
{
|
{
|
||||||
case MOSQ_ACL_SUBSCRIBE:
|
case MOSQ_ACL_SUBSCRIBE:
|
||||||
mosquitto_log_printf(MOSQ_LOG_ERR, "ACL callback subscribe defer.");
|
return (authorizer->can_read(username) ? MOSQ_ERR_SUCCESS : MOSQ_ERR_ACL_DENIED);
|
||||||
return MOSQ_ERR_PLUGIN_DEFER;
|
|
||||||
case MOSQ_ACL_UNSUBSCRIBE:
|
case MOSQ_ACL_UNSUBSCRIBE:
|
||||||
mosquitto_log_printf(MOSQ_LOG_ERR, "ACL callback unsubscribe defer.");
|
return MOSQ_ERR_SUCCESS;
|
||||||
return MOSQ_ERR_PLUGIN_DEFER;
|
|
||||||
case MOSQ_ACL_WRITE:
|
case MOSQ_ACL_WRITE:
|
||||||
success = authorizer->can_write(username);
|
|
||||||
mosquitto_log_printf(MOSQ_LOG_ERR, "ACL callback %s can write? %d", username.c_str(), success);
|
|
||||||
return (authorizer->can_write(username) ? MOSQ_ERR_SUCCESS : MOSQ_ERR_ACL_DENIED);
|
return (authorizer->can_write(username) ? MOSQ_ERR_SUCCESS : MOSQ_ERR_ACL_DENIED);
|
||||||
case MOSQ_ACL_READ:
|
case MOSQ_ACL_READ:
|
||||||
success = authorizer->can_read(username);
|
|
||||||
mosquitto_log_printf(MOSQ_LOG_ERR, "ACL callback %s can read? %d", username.c_str(), success);
|
|
||||||
return (authorizer->can_read(username) ? MOSQ_ERR_SUCCESS : MOSQ_ERR_ACL_DENIED);
|
return (authorizer->can_read(username) ? MOSQ_ERR_SUCCESS : MOSQ_ERR_ACL_DENIED);
|
||||||
default:
|
default:
|
||||||
|
mosquitto_log_printf(MOSQ_LOG_ERR, "Unhandled ACL check for user: %s", username.c_str());
|
||||||
return MOSQ_ERR_ACL_DENIED;
|
return MOSQ_ERR_ACL_DENIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue