#include <common.h>
#include <exceptions/TryCatch.h>
#include <log/log.h>
-#include <no_smack/no_smack.h>
#include <types/string_validation.h>
#include <api/ApiInterface.h>
if (!isStringValid(user) || !isStringValid(privilege))
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, returning ALLOW for "
- "(client, user, privilege): (%s, %s, %s)", client, user, privilege);
- return CYNARA_API_ACCESS_ALLOWED;
- }
-
return Cynara::tryCatch([&]() {
std::string clientStr;
std::string clientSessionStr;
if (!isStringValid(user) || !isStringValid(privilege))
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, returning ALLOW for "
- "(client, user, privilege): (%s, %s, %s)", client, user, privilege);
- if (callback) {
- *p_check_id = 1; // in case callback actualy uses it
- callback(1, cynara_async_call_cause::CYNARA_CALL_CAUSE_ANSWER,
- CYNARA_API_ACCESS_ALLOWED, user_response_data);
- }
- return CYNARA_API_SUCCESS;
- }
-
return Cynara::tryCatch([&]() {
std::string clientStr;
std::string clientSessionStr;
if (!isStringValid(user) || !isStringValid(privilege))
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, returning ALLOW "
- "(if callback is set) for async request "
- "(client, user, privilege): (%s, %s, %s)", client, user, privilege);
- *p_check_id = 1; // in case callback actualy uses it
- if (callback) {
- callback(1, cynara_async_call_cause::CYNARA_CALL_CAUSE_ANSWER,
- CYNARA_API_ACCESS_ALLOWED, user_response_data);
- }
- return CYNARA_API_SUCCESS;
- }
-
return Cynara::tryCatch([&]() {
std::string clientStr;
std::string clientSessionStr;
if (!p_cynara || !p_cynara->impl)
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, no need to cancel requests");
- return CYNARA_API_SUCCESS;
- }
-
return Cynara::tryCatch([&]() {
return p_cynara->impl->cancelRequest(check_id);
});
#include <common.h>
#include <exceptions/TryCatch.h>
#include <log/log.h>
-#include <no_smack/no_smack.h>
#include <types/string_validation.h>
#include <configuration/Configuration.h>
if (!isStringValid(user) || !isStringValid(privilege))
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, returning ALLOW for "\
- "(client, user, privilege): (%s, %s, %s)", client, user, privilege);
- return CYNARA_API_ACCESS_ALLOWED;
- }
-
return Cynara::tryCatch([&]() {
std::string clientStr;
std::string clientSessionStr;
if (!isStringValid(user) || !isStringValid(privilege))
return CYNARA_API_INVALID_PARAM;
- if (!Cynara::smack_enabled()) {
- LOGW("Cynara compiled in permissive, no-smack mode, returning ALLOW for "\
- "(client, user, privilege): (%s, %s, %s)", client, user, privilege);
- return CYNARA_API_ACCESS_ALLOWED;
- }
-
return Cynara::tryCatch([&]() {
std::string clientStr;
std::string clientSessionStr;