|
|
|
@ -194,13 +194,23 @@ int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload)
|
|
|
|
|
|
|
|
|
|
int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access)
|
|
|
|
|
{
|
|
|
|
|
char *username;
|
|
|
|
|
|
|
|
|
|
if(!context->id){
|
|
|
|
|
return MOSQ_ERR_ACL_DENIED;
|
|
|
|
|
}
|
|
|
|
|
if(!db->auth_plugin.lib){
|
|
|
|
|
return mosquitto_acl_check_default(db, context, topic, access);
|
|
|
|
|
}else{
|
|
|
|
|
return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, context->username, topic, access);
|
|
|
|
|
#ifdef WITH_BRIDGE
|
|
|
|
|
if(context->bridge){
|
|
|
|
|
username = context->bridge->local_username;
|
|
|
|
|
}else
|
|
|
|
|
#endif
|
|
|
|
|
{
|
|
|
|
|
username = context->username;
|
|
|
|
|
}
|
|
|
|
|
return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, username, topic, access);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|