From 4ff45f814846f0a1ed99c6de97adaf5133823ecb Mon Sep 17 00:00:00 2001 From: DivyPatel9881 Date: Sat, 27 Jun 2020 19:42:27 +0530 Subject: [PATCH 1/4] fix: change iteration logic for vectors and remove unwanted formating. --- casbin/model/assertion.cpp | 8 +-- casbin/model/model.cpp | 79 ++++++++++++++-------------- casbin/rbac/default_role_manager.cpp | 67 +++++++++-------------- 3 files changed, 70 insertions(+), 84 deletions(-) diff --git a/casbin/model/assertion.cpp b/casbin/model/assertion.cpp index ecb331f2..c827e0b8 100644 --- a/casbin/model/assertion.cpp +++ b/casbin/model/assertion.cpp @@ -14,8 +14,8 @@ void Assertion :: BuildIncrementalRoleLinks(RoleManager* rm, policy_op op, vecto if (char_count < 2) throw IllegalArgumentException("the number of \"_\" in role definition should be at least 2"); - for (vector> :: iterator it = this->policy.begin() ; it != this->policy.end() ; it++) { - vector rule = *it; + for(int i = 0 ; i < this->policy.size() ; i++){ + vector rule = this->policy[i]; if (rule.size() < char_count) throw IllegalArgumentException("grouping policy elements do not meet role definition"); @@ -40,8 +40,8 @@ void Assertion :: BuildRoleLinks(RoleManager* rm) { if (char_count < 2) throw IllegalArgumentException("the number of \"_\" in role definition should be at least 2"); - for (vector> :: iterator it = this->policy.begin() ; it != this->policy.end() ; it++) { - vector rule = *it; + for(int i = 0 ; i < this->policy.size() ; i++){ + vector rule = policy[i]; if (rule.size() < char_count) throw IllegalArgumentException("grouping policy elements do not meet role definition"); diff --git a/casbin/model/model.cpp b/casbin/model/model.cpp index 4bb534f6..2f0f5e1d 100644 --- a/casbin/model/model.cpp +++ b/casbin/model/model.cpp @@ -24,11 +24,12 @@ vector Model :: required_sections{"r","p","e","m"}; void Model :: LoadModelFromConfig(ConfigInterface *cfg) { for(unordered_map :: iterator it = section_name_map.begin() ; it != section_name_map.end() ; it++) LoadSection(this, cfg, it->first); + vector ms; - for(vector :: iterator it = required_sections.begin() ; it != required_sections.end() ; it++){ - if(!this->HasSection(*it)) - ms.push_back(section_name_map[*it]); - } + for(int i=0 ; i < required_sections.size() ; i++) + if(!this->HasSection(required_sections[i])) + ms.push_back(section_name_map[required_sections[i]]); + if(ms.size() > 0) throw MissingRequiredSections("missing required sections: " + Join(ms, ",")); } @@ -66,20 +67,22 @@ bool Model :: LoadAssertion(Model* model, ConfigInterface* cfg, string sec, stri bool Model :: AddDef(string sec, string key, string value) { if(value == "") return false; - Assertion ast; - ast.key = key; - ast.value = value; + + Assertion* ast = new Assertion; + ast->key = key; + ast->value = value; if (sec == "r" || sec == "p") { - ast.tokens = Split(ast.value, ","); - for (int i = 0; i < ast.tokens.size() ; i++) - ast.tokens[i] = key + "_" + Trim(ast.tokens[i]); + ast->tokens = Split(ast->value, ","); + for (int i = 0; i < ast->tokens.size() ; i++) + ast->tokens[i] = key + "_" + Trim(ast->tokens[i]); } else - ast.value = RemoveComments(EscapeAssertion(ast.value)); + ast->value = RemoveComments(EscapeAssertion(ast->value)); if (m.find(sec) != m.end()) m[sec] = AssertionMap(); - m[sec].assertion_map[key] = * + ast->policy = vector>{}; + m[sec].assertion_map[key] = ast; return true; } @@ -167,13 +170,13 @@ void Model :: PrintPolicy() { // ClearPolicy clears all current policy. void Model :: ClearPolicy() { - for (unordered_map :: iterator it = this->m["p"].assertion_map.begin() ; it != this->m["p"].assertion_map.end() ; it++) { - (it->second)->policy.clear(); - } + for (unordered_map :: iterator it = this->m["p"].assertion_map.begin() ; it != this->m["p"].assertion_map.end() ; it++) + if((it->second)->policy.size() > 0) + (it->second)->policy.clear(); - for (unordered_map :: iterator it = this->m["g"].assertion_map.begin() ; it != this->m["g"].assertion_map.end() ; it++) { - (it->second)->policy.clear(); - } + for (unordered_map :: iterator it = this->m["g"].assertion_map.begin() ; it != this->m["g"].assertion_map.end() ; it++) + if((it->second)->policy.size() > 0) + (it->second)->policy.clear(); } // GetPolicy gets all rules in a policy. @@ -184,18 +187,17 @@ vector> Model :: GetPolicy(string sec, string p_type) { // GetFilteredPolicy gets rules based on field filters from a policy. vector> Model :: GetFilteredPolicy(string sec, string p_type, int field_index, vector field_values) { vector> res; - - for (vector> :: iterator it = m[sec].assertion_map[p_type]->policy.begin() ; it != m[sec].assertion_map[p_type]->policy.end() ; it++){ + vector> policy(m[sec].assertion_map[p_type]->policy); + for(int i = 0 ; i < policy.size() ; i++){ bool matched = true; for(int i = 0 ; i < field_values.size() ; i++){ - if(field_values[i] != "" && (*it)[field_index + i] != field_values[i] ){ + if(field_values[i] != "" && (policy[i])[field_index + i] != field_values[i] ){ matched = false; break; } } - if(matched) { - res.push_back(*it); - } + if(matched) + res.push_back(policy[i]); } return res; @@ -203,11 +205,10 @@ vector> Model :: GetFilteredPolicy(string sec, string p_type, int // HasPolicy determines whether a model has the specified policy rule. bool Model :: HasPolicy(string sec, string p_type, vector rule) { - for (vector> :: iterator it = m[sec].assertion_map[p_type]->policy.begin() ; it != m[sec].assertion_map[p_type]->policy.end() ; it++) { - if (ArrayEquals(rule, *it)) { + vector> policy(m[sec].assertion_map[p_type]->policy); + for(int i=0 ; i < policy.size() ; i++) + if (ArrayEquals(rule, policy[i])) return true; - } - } return false; } @@ -267,21 +268,22 @@ bool Model :: RemovePolicies(string sec, string p_type, vector> r pair>> Model :: RemoveFilteredPolicy(string sec, string p_type, int field_index, vector field_values) { vector> tmp; vector> effects; + vector> policy(m[sec].assertion_map[p_type]->policy); bool res = false; - for (vector> :: iterator it = m[sec].assertion_map[p_type]->policy.begin() ; it != m[sec].assertion_map[p_type]->policy.end() ; it++) { + for(int i = 0 ; i < policy.size() ; i++){ bool matched = true; for (int i = 0 ; i < field_values.size() ; i++) { - if (field_values[i] != "" && (*it)[field_index+i] != field_values[i]) { + if (field_values[i] != "" && (policy[i])[field_index+i] != field_values[i]) { matched = false; break; } } if (matched){ - effects.push_back(*it); + effects.push_back(policy[i]); res = true; } else - tmp.push_back(*it); + tmp.push_back(policy[i]); } m[sec].assertion_map[p_type]->policy = tmp; @@ -292,10 +294,9 @@ pair>> Model :: RemoveFilteredPolicy(string sec, str // GetValuesForFieldInPolicy gets all values for a field for all rules in a policy, duplicated values are removed. vector Model :: GetValuesForFieldInPolicy(string sec, string p_type, int field_index) { vector values; - - for (vector> :: iterator it = m[sec].assertion_map[p_type]->policy.begin() ; it != m[sec].assertion_map[p_type]->policy.end() ; it++){ - values.push_back((*it)[field_index]); - } + vector> policy(m[sec].assertion_map[p_type]->policy); + for(int i = 0 ; i < policy.size() ; i++) + values.push_back((policy[i])[field_index]); ArrayRemoveDuplicates(values); @@ -307,9 +308,9 @@ vector Model :: GetValuesForFieldInPolicyAllTypes(string sec, int field_ vector values; for (unordered_map :: iterator it = m[sec].assertion_map.begin() ; it != m[sec].assertion_map.end() ; it++) { - for (vector :: iterator it1 = this->GetValuesForFieldInPolicy(sec, it->first, field_index).begin() ; it1 != this->GetValuesForFieldInPolicy(sec, it->first, field_index).end() ; it1++) { - values.push_back(*it1); - } + vector values_for_field(this->GetValuesForFieldInPolicy(sec, it->first, field_index)); + for(int i = 0 ; i < values_for_field.size() ; i++) + values.push_back(values_for_field[i]); } ArrayRemoveDuplicates(values); diff --git a/casbin/rbac/default_role_manager.cpp b/casbin/rbac/default_role_manager.cpp index e6c227e6..c9680aed 100644 --- a/casbin/rbac/default_role_manager.cpp +++ b/casbin/rbac/default_role_manager.cpp @@ -29,28 +29,23 @@ void Role :: DeleteRole(Role* role) { } bool Role :: HasRole(string name, int hierarchy_level) { - if (!this->name.compare(name)) { + if (!this->name.compare(name)) return true; - } - if (hierarchy_level <= 0) { + if (hierarchy_level <= 0) return false; - } - for (vector :: iterator it = roles.begin() ; it != roles.end() ; it++) { - if ((*it)->HasRole(name, hierarchy_level - 1)) { + for(int i = 0 ; i < roles.size() ; i++) + if (roles[i]->HasRole(name, hierarchy_level - 1)) return true; - } - } + return false; } bool Role :: HasDirectRole(string name) { - for (vector :: iterator it = roles.begin() ; it != roles.end() ; it++) { - if (!(*it)->name.compare(name)) { + for(int i = 0 ; i < roles.size() ; i++) + if (!roles[i]->name.compare(name)) return true; - } - } return false; } @@ -70,22 +65,20 @@ string Role :: ToString() { vector Role :: GetRoles() { vector names; - for (vector :: iterator it = roles.begin() ; it != roles.end() ; it++) { - names.push_back((*it)->name); - } + for(int i = 0 ; i < roles.size() ; i++) + names.push_back(roles[i]->name); + return names; } bool DefaultRoleManager :: HasRole(string name) { bool ok = false; - if (this->has_pattern) { - for (unordered_map :: iterator it = this->all_roles.begin() ; it != this->all_roles.end() ; it++) { + if (this->has_pattern) + for (unordered_map :: iterator it = this->all_roles.begin() ; it != this->all_roles.end() ; it++) if (this->matching_func(name, it->first)) ok = true; - } - } else { + else ok = this->all_roles.find(name) != this->all_roles.end(); - } return ok; } @@ -172,13 +165,11 @@ void DefaultRoleManager :: DeleteLink(string name1, string name2, vector if (domain_length == 1) { name1 = domain[0] + "::" + name1; name2 = domain[0] + "::" + name2; - } else if (domain_length > 1) { + } else if (domain_length > 1) throw CasbinRBACException("error: domain should be 1 parameter"); - } - if (!HasRole(name1) || !HasRole(name2)) { + if (!HasRole(name1) || !HasRole(name2)) throw CasbinRBACException("error: name1 or name2 does not exist"); - } Role* role1 = this->CreateRole(name1); Role* role2 = this->CreateRole(name2); @@ -194,17 +185,14 @@ bool DefaultRoleManager :: HasLink(string name1, string name2, vector do if (domain_length == 1) { name1 = domain[0] + "::" + name1; name2 = domain[0] + "::" + name2; - } else if (domain_length > 1) { + } else if (domain_length > 1) throw CasbinRBACException("error: domain should be 1 parameter"); - } - if (!name1.compare(name2)) { + if (!name1.compare(name2)) return true; - } - if (!HasRole(name1) || !HasRole(name2)) { + if (!HasRole(name1) || !HasRole(name2)) return false; - } Role* role1 = this->CreateRole(name1); return role1->HasRole(name2, max_hierarchy_level); @@ -216,11 +204,10 @@ bool DefaultRoleManager :: HasLink(string name1, string name2, vector do */ vector DefaultRoleManager :: GetRoles(string name, vector domain) { unsigned int domain_length = int(domain.size()); - if (domain_length == 1) { + if (domain_length == 1) name = domain[0] + "::" + name; - } else if (domain_length > 1) { + else if (domain_length > 1) throw CasbinRBACException("error: domain should be 1 parameter"); - } if (!HasRole(name)) { vector roles; @@ -228,11 +215,10 @@ vector DefaultRoleManager :: GetRoles(string name, vector domain } vector roles = this->CreateRole(name)->GetRoles(); - if (domain_length == 1) { - for (int i = 0; i < roles.size(); i ++) { + if (domain_length == 1) + for (int i = 0; i < roles.size(); i ++) roles[i] = roles[i].substr(domain[0].length() + 2, roles[i].length() - domain[0].length() - 2); - } - } + return roles; } @@ -252,10 +238,10 @@ vector DefaultRoleManager :: GetUsers(string name, vector domain names.push_back(role->name); } - if (domain.size() == 1) { + if (domain.size() == 1) for (int i = 0 ; i < names.size() ; i++) names[i] = names[i].substr(domain[0].length() + 2, names[i].length() - domain[0].length() - 2); - } + return names; } @@ -272,8 +258,7 @@ void DefaultRoleManager :: PrintRoles() { string text = this->all_roles.begin()->second->ToString(); unordered_map :: iterator it = this->all_roles.begin(); it++; - for ( ; it != this->all_roles.end() ; it++) { + for ( ; it != this->all_roles.end() ; it++) text += ", " + it->second->ToString(); - } // LogUtil::LogPrint(text); } \ No newline at end of file From 269bbec0e129083e036fe7acfe8845ad2576262c Mon Sep 17 00:00:00 2001 From: DivyPatel9881 Date: Sat, 27 Jun 2020 19:59:19 +0530 Subject: [PATCH 2/4] fix: cast warnings. --- casbin/model/Assertion.h | 3 ++- casbin/util/built_in_functions.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/casbin/model/Assertion.h b/casbin/model/Assertion.h index a8a8467f..7cfb2b24 100644 --- a/casbin/model/Assertion.h +++ b/casbin/model/Assertion.h @@ -7,6 +7,7 @@ enum policy_op{ policy_add, policy_remove }; +typedef enum policy_op policy_op; // Assertion represents an expression in a section of the model. // For example: r = sub, obj, act @@ -17,7 +18,7 @@ class Assertion { string value; vector tokens; vector> policy; - RoleManager *rm; + RoleManager* rm; void BuildIncrementalRoleLinks(RoleManager* rm, policy_op op, vector> rules); diff --git a/casbin/util/built_in_functions.cpp b/casbin/util/built_in_functions.cpp index ffce2f5d..75b7eb15 100644 --- a/casbin/util/built_in_functions.cpp +++ b/casbin/util/built_in_functions.cpp @@ -53,8 +53,8 @@ ReturnType KeyMatch2(Scope scope) { break; } if(key1_arr[i] != key2_arr[i]){ - int index1 = key2_arr[i].find("*"); - int index2 = key2_arr[i].find(":"); + int index1 = int(key2_arr[i].find("*")); + int index2 = int(key2_arr[i].find(":")); if(index1 != string::npos){ if(index1==0){ res = true; @@ -103,9 +103,9 @@ ReturnType KeyMatch3(Scope scope) { break; } if(key1_arr[i] != key2_arr[i]){ - int index1 = key2_arr[i].find("*"); - int index2 = key2_arr[i].find("{"); - int index3 = key2_arr[i].find("}"); + int index1 = int(key2_arr[i].find("*")); + int index2 = int(key2_arr[i].find("{")); + int index3 = int(key2_arr[i].find("}")); if(index1 != string::npos){ if(index1==0){ res = true; From d4dba11f3aa692cb1ed98b7db8255132cc6a9b9f Mon Sep 17 00:00:00 2001 From: DivyPatel9881 Date: Sat, 27 Jun 2020 20:03:26 +0530 Subject: [PATCH 3/4] fix: formatting of role manager of implementation --- casbin/rbac/default_role_manager.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/casbin/rbac/default_role_manager.cpp b/casbin/rbac/default_role_manager.cpp index c9680aed..8fe61d15 100644 --- a/casbin/rbac/default_role_manager.cpp +++ b/casbin/rbac/default_role_manager.cpp @@ -22,9 +22,8 @@ void Role :: AddRole(Role* role) { void Role :: DeleteRole(Role* role) { for (int i = 0; i < roles.size();i++) { - if (!roles[i]->name.compare(role->name)) { + if (!roles[i]->name.compare(role->name)) roles.erase(roles.begin()+i); - } } } @@ -35,17 +34,19 @@ bool Role :: HasRole(string name, int hierarchy_level) { if (hierarchy_level <= 0) return false; - for(int i = 0 ; i < roles.size() ; i++) + for(int i = 0 ; i < roles.size() ; i++){ if (roles[i]->HasRole(name, hierarchy_level - 1)) return true; + } return false; } bool Role :: HasDirectRole(string name) { - for(int i = 0 ; i < roles.size() ; i++) + for(int i = 0 ; i < roles.size() ; i++){ if (!roles[i]->name.compare(name)) return true; + } return false; } @@ -73,10 +74,12 @@ vector Role :: GetRoles() { bool DefaultRoleManager :: HasRole(string name) { bool ok = false; - if (this->has_pattern) - for (unordered_map :: iterator it = this->all_roles.begin() ; it != this->all_roles.end() ; it++) + if (this->has_pattern){ + for (unordered_map :: iterator it = this->all_roles.begin() ; it != this->all_roles.end() ; it++){ if (this->matching_func(name, it->first)) ok = true; + } + } else ok = this->all_roles.find(name) != this->all_roles.end(); @@ -146,9 +149,8 @@ void DefaultRoleManager :: AddLink(string name1, string name2, vector do if (domain.size() == 1) { name1 = domain[0] + "::" + name1; name2 = domain[0] + "::" + name2; - } else if (domain.size() > 1) { + } else if (domain.size() > 1) throw CasbinRBACException("error: domain should be 1 parameter"); - } Role* role1 = this->CreateRole(name1); Role* role2 = this->CreateRole(name2); @@ -215,9 +217,10 @@ vector DefaultRoleManager :: GetRoles(string name, vector domain } vector roles = this->CreateRole(name)->GetRoles(); - if (domain_length == 1) + if (domain_length == 1){ for (int i = 0; i < roles.size(); i ++) roles[i] = roles[i].substr(domain[0].length() + 2, roles[i].length() - domain[0].length() - 2); + } return roles; } @@ -238,9 +241,10 @@ vector DefaultRoleManager :: GetUsers(string name, vector domain names.push_back(role->name); } - if (domain.size() == 1) + if (domain.size() == 1){ for (int i = 0 ; i < names.size() ; i++) names[i] = names[i].substr(domain[0].length() + 2, names[i].length() - domain[0].length() - 2); + } return names; } From 376c972d614ca7909964d200a4dbe8f5da963430 Mon Sep 17 00:00:00 2001 From: DivyPatel9881 Date: Sat, 27 Jun 2020 20:17:57 +0530 Subject: [PATCH 4/4] feat: add license header to the source files. --- casbin/config.h | 16 ++++++++++++++++ casbin/config/Config.h | 16 ++++++++++++++++ casbin/config/config.cpp | 16 ++++++++++++++++ casbin/config/config_interface.h | 16 ++++++++++++++++ casbin/duktape.h | 16 ++++++++++++++++ casbin/effect.h | 16 ++++++++++++++++ casbin/effect/Effect.h | 16 ++++++++++++++++ casbin/effect/Effector.h | 16 ++++++++++++++++ casbin/effect/default_effector.cpp | 16 ++++++++++++++++ casbin/effect/default_effector.h | 16 ++++++++++++++++ casbin/enforcer.cpp | 16 ++++++++++++++++ casbin/enforcer.h | 1 + casbin/enforcer_interface.h | 16 ++++++++++++++++ casbin/internal_api.cpp | 16 ++++++++++++++++ casbin/management_api.cpp | 16 ++++++++++++++++ casbin/model.h | 16 ++++++++++++++++ casbin/model/Assertion.h | 16 ++++++++++++++++ casbin/model/Function.h | 16 ++++++++++++++++ casbin/model/Model.h | 16 ++++++++++++++++ casbin/model/assertion.cpp | 16 ++++++++++++++++ casbin/model/function.cpp | 16 ++++++++++++++++ casbin/model/model.cpp | 16 ++++++++++++++++ casbin/model/scope_config.cpp | 16 ++++++++++++++++ casbin/model/scope_config.h | 16 ++++++++++++++++ casbin/persist.h | 16 ++++++++++++++++ casbin/persist/Adapter.h | 16 ++++++++++++++++ casbin/persist/Adapter_Filtered.h | 16 ++++++++++++++++ casbin/persist/Watcher.h | 16 ++++++++++++++++ casbin/persist/adapter.cpp | 16 ++++++++++++++++ casbin/persist/batch_adapter.h | 16 ++++++++++++++++ casbin/persist/default_watcher.cpp | 16 ++++++++++++++++ casbin/persist/default_watcher.h | 16 ++++++++++++++++ casbin/persist/default_watcher_ex.cpp | 16 ++++++++++++++++ casbin/persist/default_watcher_ex.h | 16 ++++++++++++++++ casbin/persist/watcher_ex.h | 16 ++++++++++++++++ casbin/rbac.h | 16 ++++++++++++++++ casbin/rbac/default_role_manager.cpp | 16 ++++++++++++++++ casbin/rbac/default_role_manager.h | 16 ++++++++++++++++ casbin/rbac/role_manager.h | 16 ++++++++++++++++ casbin/rbac_api.cpp | 16 ++++++++++++++++ casbin/rbac_api_with_domains.cpp | 16 ++++++++++++++++ casbin/util.h | 16 ++++++++++++++++ casbin/util/array_equals.cpp | 16 ++++++++++++++++ casbin/util/array_remove_duplicates.cpp | 16 ++++++++++++++++ casbin/util/array_to_string.cpp | 16 ++++++++++++++++ casbin/util/built_in_functions.cpp | 16 ++++++++++++++++ casbin/util/built_in_functions.h | 16 ++++++++++++++++ casbin/util/ends_with.cpp | 16 ++++++++++++++++ casbin/util/escape_assertion.cpp | 16 ++++++++++++++++ casbin/util/find_all_occurences.cpp | 16 ++++++++++++++++ casbin/util/is_instance_of.cpp | 16 ++++++++++++++++ casbin/util/join.cpp | 16 ++++++++++++++++ casbin/util/join_slice.cpp | 16 ++++++++++++++++ casbin/util/remove_comments.cpp | 16 ++++++++++++++++ casbin/util/set_subtract.cpp | 16 ++++++++++++++++ casbin/util/split.cpp | 16 ++++++++++++++++ casbin/util/trim.cpp | 16 ++++++++++++++++ casbin/util/util.h | 16 ++++++++++++++++ 58 files changed, 913 insertions(+) diff --git a/casbin/config.h b/casbin/config.h index 55f64891..bba436e2 100644 --- a/casbin/config.h +++ b/casbin/config.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_CONFIG #define CASBIN_CPP_CONFIG diff --git a/casbin/config/Config.h b/casbin/config/Config.h index 4c5afa52..8b74ccb9 100644 --- a/casbin/config/Config.h +++ b/casbin/config/Config.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_CONFIG_CONFIG #define CASBIN_CPP_CONFIG_CONFIG diff --git a/casbin/config/config.cpp b/casbin/config/config.cpp index 26ef3edf..02ac90be 100644 --- a/casbin/config/config.cpp +++ b/casbin/config/config.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/config/config_interface.h b/casbin/config/config_interface.h index 99ffa01f..e1adbab6 100644 --- a/casbin/config/config_interface.h +++ b/casbin/config/config_interface.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_CONFIG_CONFIG_INTERFACE #define CASBIN_CPP_CONFIG_CONFIG_INTERFACE diff --git a/casbin/duktape.h b/casbin/duktape.h index 8ac0dd88..e4888da0 100644 --- a/casbin/duktape.h +++ b/casbin/duktape.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_DUKTAPE #define CASBIN_CPP_DUKTAPE diff --git a/casbin/effect.h b/casbin/effect.h index f0ec199b..9b3d0acd 100644 --- a/casbin/effect.h +++ b/casbin/effect.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_EFFECT #define CASBIN_CPP_EFFECT diff --git a/casbin/effect/Effect.h b/casbin/effect/Effect.h index aa7c3bad..dbc3530f 100644 --- a/casbin/effect/Effect.h +++ b/casbin/effect/Effect.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_EFFECT_EFFECT #define CASBIN_CPP_EFFECT_EFFECT diff --git a/casbin/effect/Effector.h b/casbin/effect/Effector.h index 8e10d5f5..b628870f 100644 --- a/casbin/effect/Effector.h +++ b/casbin/effect/Effector.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_EFFECT_EFFECTOR #define CASBIN_CPP_EFFECT_EFFECTOR diff --git a/casbin/effect/default_effector.cpp b/casbin/effect/default_effector.cpp index 67e77394..8bff2093 100644 --- a/casbin/effect/default_effector.cpp +++ b/casbin/effect/default_effector.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/effect/default_effector.h b/casbin/effect/default_effector.h index 6456970a..b6c6c720 100644 --- a/casbin/effect/default_effector.h +++ b/casbin/effect/default_effector.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_EFFECT_DEFAULT_EFFECTOR #define CASBIN_CPP_EFFECT_DEFAULT_EFFECTOR diff --git a/casbin/enforcer.cpp b/casbin/enforcer.cpp index bc7797c8..7c514b23 100644 --- a/casbin/enforcer.cpp +++ b/casbin/enforcer.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/enforcer.h b/casbin/enforcer.h index 377b85ff..7234622a 100644 --- a/casbin/enforcer.h +++ b/casbin/enforcer.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef CASBIN_CPP_ENFORCER #define CASBIN_CPP_ENFORCER diff --git a/casbin/enforcer_interface.h b/casbin/enforcer_interface.h index 16939883..7b1424fe 100644 --- a/casbin/enforcer_interface.h +++ b/casbin/enforcer_interface.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_ENFORCER_INTERFACE #define CASBIN_CPP_ENFORCER_INTERFACE diff --git a/casbin/internal_api.cpp b/casbin/internal_api.cpp index 8245fce2..33597955 100644 --- a/casbin/internal_api.cpp +++ b/casbin/internal_api.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/management_api.cpp b/casbin/management_api.cpp index dd77952e..f2dae877 100644 --- a/casbin/management_api.cpp +++ b/casbin/management_api.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/model.h b/casbin/model.h index e2a1196d..0fca1639 100644 --- a/casbin/model.h +++ b/casbin/model.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_MODEL #define CASBIN_CPP_MODEL diff --git a/casbin/model/Assertion.h b/casbin/model/Assertion.h index 7cfb2b24..8a35a549 100644 --- a/casbin/model/Assertion.h +++ b/casbin/model/Assertion.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_MODEL_ASSERTION #define CASBIN_CPP_MODEL_ASSERTION diff --git a/casbin/model/Function.h b/casbin/model/Function.h index 97253eec..6a80fcb8 100644 --- a/casbin/model/Function.h +++ b/casbin/model/Function.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_MODEL_FUNCTION #define CASBIN_CPP_MODEL_FUNCTION diff --git a/casbin/model/Model.h b/casbin/model/Model.h index e91bb35d..b11aa0fb 100644 --- a/casbin/model/Model.h +++ b/casbin/model/Model.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_MODEL_MODEL #define CASBIN_CPP_MODEL_MODEL diff --git a/casbin/model/assertion.cpp b/casbin/model/assertion.cpp index c827e0b8..b583f45c 100644 --- a/casbin/model/assertion.cpp +++ b/casbin/model/assertion.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/model/function.cpp b/casbin/model/function.cpp index 22719f1b..606652d8 100644 --- a/casbin/model/function.cpp +++ b/casbin/model/function.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/model/model.cpp b/casbin/model/model.cpp index 2f0f5e1d..080111a9 100644 --- a/casbin/model/model.cpp +++ b/casbin/model/model.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/model/scope_config.cpp b/casbin/model/scope_config.cpp index 26f84961..1df22cf7 100644 --- a/casbin/model/scope_config.cpp +++ b/casbin/model/scope_config.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/model/scope_config.h b/casbin/model/scope_config.h index 87a8d4eb..3ffd9a7b 100644 --- a/casbin/model/scope_config.h +++ b/casbin/model/scope_config.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_MODEL_SCOPE_CONFIG #define CASBIN_CPP_MODEL_SCOPE_CONFIG diff --git a/casbin/persist.h b/casbin/persist.h index e857eb7e..6f3bb043 100644 --- a/casbin/persist.h +++ b/casbin/persist.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST #define CASBIN_CPP_PERSIST diff --git a/casbin/persist/Adapter.h b/casbin/persist/Adapter.h index 2acc37bc..8ec9ab50 100644 --- a/casbin/persist/Adapter.h +++ b/casbin/persist/Adapter.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_ADAPTER #define CASBIN_CPP_PERSIST_ADAPTER diff --git a/casbin/persist/Adapter_Filtered.h b/casbin/persist/Adapter_Filtered.h index 437b31cf..5d7023e7 100644 --- a/casbin/persist/Adapter_Filtered.h +++ b/casbin/persist/Adapter_Filtered.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_ADAPTER_FILTERED #define CASBIN_CPP_PERSIST_ADAPTER_FILTERED diff --git a/casbin/persist/Watcher.h b/casbin/persist/Watcher.h index d35c234c..5bc93116 100644 --- a/casbin/persist/Watcher.h +++ b/casbin/persist/Watcher.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_WATCHER #define CASBIN_CPP_PERSIST_WATCHER diff --git a/casbin/persist/adapter.cpp b/casbin/persist/adapter.cpp index c774a3cd..9363572a 100644 --- a/casbin/persist/adapter.cpp +++ b/casbin/persist/adapter.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/persist/batch_adapter.h b/casbin/persist/batch_adapter.h index 9e9cdf77..3c39d2e2 100644 --- a/casbin/persist/batch_adapter.h +++ b/casbin/persist/batch_adapter.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_BATCH_ADAPTER #define CASBIN_CPP_PERSIST_BATCH_ADAPTER diff --git a/casbin/persist/default_watcher.cpp b/casbin/persist/default_watcher.cpp index f62b94f2..a341005b 100644 --- a/casbin/persist/default_watcher.cpp +++ b/casbin/persist/default_watcher.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/persist/default_watcher.h b/casbin/persist/default_watcher.h index a4a600e2..1f523e7c 100644 --- a/casbin/persist/default_watcher.h +++ b/casbin/persist/default_watcher.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_DEFAULT_WATCHER #define CASBIN_CPP_PERSIST_DEFAULT_WATCHER diff --git a/casbin/persist/default_watcher_ex.cpp b/casbin/persist/default_watcher_ex.cpp index a59ae5ff..3560cb37 100644 --- a/casbin/persist/default_watcher_ex.cpp +++ b/casbin/persist/default_watcher_ex.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/persist/default_watcher_ex.h b/casbin/persist/default_watcher_ex.h index 3db9f389..3426a8c5 100644 --- a/casbin/persist/default_watcher_ex.h +++ b/casbin/persist/default_watcher_ex.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_DEFAULT_WATCHER_EX #define CASBIN_CPP_PERSIST_DEFAULT_WATCHER_EX diff --git a/casbin/persist/watcher_ex.h b/casbin/persist/watcher_ex.h index 85fd2bcd..c020e034 100644 --- a/casbin/persist/watcher_ex.h +++ b/casbin/persist/watcher_ex.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_PERSIST_WATCHER_EX #define CASBIN_CPP_PERSIST_WATCHER_EX diff --git a/casbin/rbac.h b/casbin/rbac.h index b8cbab3f..18b7f70a 100644 --- a/casbin/rbac.h +++ b/casbin/rbac.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_RBAC #define CASBIN_CPP_RBAC diff --git a/casbin/rbac/default_role_manager.cpp b/casbin/rbac/default_role_manager.cpp index 8fe61d15..029f4faf 100644 --- a/casbin/rbac/default_role_manager.cpp +++ b/casbin/rbac/default_role_manager.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/rbac/default_role_manager.h b/casbin/rbac/default_role_manager.h index 136335dd..ecb0571b 100644 --- a/casbin/rbac/default_role_manager.h +++ b/casbin/rbac/default_role_manager.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_RBAC_DEFAULT_ROLE_MANAGER #define CASBIN_CPP_RBAC_DEFAULT_ROLE_MANAGER diff --git a/casbin/rbac/role_manager.h b/casbin/rbac/role_manager.h index 2aa71d0e..e23c0686 100644 --- a/casbin/rbac/role_manager.h +++ b/casbin/rbac/role_manager.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_RBAC_ROLE_MANAGER #define CASBIN_CPP_RBAC_ROLE_MANAGER diff --git a/casbin/rbac_api.cpp b/casbin/rbac_api.cpp index 9cfd61fd..a28fdb45 100644 --- a/casbin/rbac_api.cpp +++ b/casbin/rbac_api.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/rbac_api_with_domains.cpp b/casbin/rbac_api_with_domains.cpp index 049f0b9d..01a30ed7 100644 --- a/casbin/rbac_api_with_domains.cpp +++ b/casbin/rbac_api_with_domains.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util.h b/casbin/util.h index 9b787031..c4caa340 100644 --- a/casbin/util.h +++ b/casbin/util.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_UTIL #define CASBIN_CPP_UTIL diff --git a/casbin/util/array_equals.cpp b/casbin/util/array_equals.cpp index d3dc0b00..658cffa0 100644 --- a/casbin/util/array_equals.cpp +++ b/casbin/util/array_equals.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/array_remove_duplicates.cpp b/casbin/util/array_remove_duplicates.cpp index 0c907ca4..9ad15419 100644 --- a/casbin/util/array_remove_duplicates.cpp +++ b/casbin/util/array_remove_duplicates.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/array_to_string.cpp b/casbin/util/array_to_string.cpp index 32f1c07b..0695778a 100644 --- a/casbin/util/array_to_string.cpp +++ b/casbin/util/array_to_string.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/built_in_functions.cpp b/casbin/util/built_in_functions.cpp index 75b7eb15..9cd05e05 100644 --- a/casbin/util/built_in_functions.cpp +++ b/casbin/util/built_in_functions.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/built_in_functions.h b/casbin/util/built_in_functions.h index 90c9b3d3..c8fcbb1d 100644 --- a/casbin/util/built_in_functions.h +++ b/casbin/util/built_in_functions.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_UTIL_BUILT_IN_FUNCTIONS #define CASBIN_CPP_UTIL_BUILT_IN_FUNCTIONS diff --git a/casbin/util/ends_with.cpp b/casbin/util/ends_with.cpp index 6044381a..e0d88aee 100644 --- a/casbin/util/ends_with.cpp +++ b/casbin/util/ends_with.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/escape_assertion.cpp b/casbin/util/escape_assertion.cpp index cfb453ad..5c041510 100644 --- a/casbin/util/escape_assertion.cpp +++ b/casbin/util/escape_assertion.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/find_all_occurences.cpp b/casbin/util/find_all_occurences.cpp index 97f4a051..a34d152e 100644 --- a/casbin/util/find_all_occurences.cpp +++ b/casbin/util/find_all_occurences.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/is_instance_of.cpp b/casbin/util/is_instance_of.cpp index db5843c9..89932751 100644 --- a/casbin/util/is_instance_of.cpp +++ b/casbin/util/is_instance_of.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/join.cpp b/casbin/util/join.cpp index e1510053..6c4c13af 100644 --- a/casbin/util/join.cpp +++ b/casbin/util/join.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/join_slice.cpp b/casbin/util/join_slice.cpp index 73074b20..c1d5eb08 100644 --- a/casbin/util/join_slice.cpp +++ b/casbin/util/join_slice.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/remove_comments.cpp b/casbin/util/remove_comments.cpp index 94f4c86d..77d29ab5 100644 --- a/casbin/util/remove_comments.cpp +++ b/casbin/util/remove_comments.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/set_subtract.cpp b/casbin/util/set_subtract.cpp index debea89c..f4fd2aab 100644 --- a/casbin/util/set_subtract.cpp +++ b/casbin/util/set_subtract.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/split.cpp b/casbin/util/split.cpp index 83e603ff..4b2f656f 100644 --- a/casbin/util/split.cpp +++ b/casbin/util/split.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/trim.cpp b/casbin/util/trim.cpp index 66c4898f..42eba4e7 100644 --- a/casbin/util/trim.cpp +++ b/casbin/util/trim.cpp @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #pragma once #include "pch.h" diff --git a/casbin/util/util.h b/casbin/util/util.h index 5d029581..7fd700c2 100644 --- a/casbin/util/util.h +++ b/casbin/util/util.h @@ -1,3 +1,19 @@ +/* +* Copyright 2020 The casbin Authors. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + #ifndef CASBIN_CPP_UTIL_UTIL #define CASBIN_CPP_UTIL_UTIL