@@ -280,43 +280,43 @@ std::vector<std::string> SyncedEnforcer ::GetAllNamedRoles(const std::string& pt
280280}
281281
282282// GetPolicy gets all the authorization rules in the policy.
283- std::vector<std::vector<std::string>> SyncedEnforcer ::GetPolicy () {
283+ PoliciesValues SyncedEnforcer ::GetPolicy () {
284284 std::shared_lock<std::shared_mutex> lock (policyMutex);
285285 return Enforcer::GetPolicy ();
286286}
287287
288288// GetNamedPolicy gets all the authorization rules in the name:x::d policy.
289- std::vector<std::vector<std::string>> SyncedEnforcer ::GetNamedPolicy (const std::string& ptype) {
289+ PoliciesValues SyncedEnforcer ::GetNamedPolicy (const std::string& ptype) {
290290 std::shared_lock<std::shared_mutex> lock (policyMutex);
291291 return Enforcer::GetNamedPolicy (ptype);
292292}
293293
294294// GetFilteredNamedPolicy gets all the authorization rules in the named policy, field filters can be specified.
295- std::vector<std::vector<std::string>> SyncedEnforcer ::GetFilteredNamedPolicy (const std::string& ptype, int fieldIndex, const std::vector<std::string>& fieldValues) {
295+ PoliciesValues SyncedEnforcer ::GetFilteredNamedPolicy (const std::string& ptype, int fieldIndex, const std::vector<std::string>& fieldValues) {
296296 std::shared_lock<std::shared_mutex> lock (policyMutex);
297297 return Enforcer::GetFilteredNamedPolicy (ptype, fieldIndex, fieldValues);
298298}
299299
300300// GetGroupingPolicy gets all the role inheritance rules in the policy.
301- std::vector<std::vector<std::string>> SyncedEnforcer ::GetGroupingPolicy () {
301+ PoliciesValues SyncedEnforcer ::GetGroupingPolicy () {
302302 std::shared_lock<std::shared_mutex> lock (policyMutex);
303303 return Enforcer::GetGroupingPolicy ();
304304}
305305
306306// GetFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
307- std::vector<std::vector<std::string>> SyncedEnforcer ::GetFilteredGroupingPolicy (int fieldIndex, const std::vector<std::string>& fieldValues) {
307+ PoliciesValues SyncedEnforcer ::GetFilteredGroupingPolicy (int fieldIndex, const std::vector<std::string>& fieldValues) {
308308 std::shared_lock<std::shared_mutex> lock (policyMutex);
309309 return Enforcer::GetFilteredGroupingPolicy (fieldIndex, fieldValues);
310310}
311311
312312// GetNamedGroupingPolicy gets all the role inheritance rules in the policy.
313- std::vector<std::vector<std::string>> SyncedEnforcer ::GetNamedGroupingPolicy (const std::string& ptype) {
313+ PoliciesValues SyncedEnforcer ::GetNamedGroupingPolicy (const std::string& ptype) {
314314 std::shared_lock<std::shared_mutex> lock (policyMutex);
315315 return Enforcer::GetNamedGroupingPolicy (ptype);
316316}
317317
318318// GetFilteredNamedGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
319- std::vector<std::vector<std::string>> SyncedEnforcer ::GetFilteredNamedGroupingPolicy (const std::string& ptype, int fieldIndex, const std::vector<std::string>& fieldValues) {
319+ PoliciesValues SyncedEnforcer ::GetFilteredNamedGroupingPolicy (const std::string& ptype, int fieldIndex, const std::vector<std::string>& fieldValues) {
320320 std::shared_lock<std::shared_mutex> lock (policyMutex);
321321 return Enforcer::GetFilteredNamedGroupingPolicy (ptype, fieldIndex, fieldValues);
322322}
@@ -344,7 +344,7 @@ bool SyncedEnforcer ::AddPolicy(const std::vector<std::string>& params) {
344344// AddPolicies adds authorization rules to the current policy.
345345// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
346346// Otherwise the function returns true for the corresponding rule by adding the new rule.
347- bool SyncedEnforcer ::AddPolicies (const std::vector<std::vector<std::string>> & rules) {
347+ bool SyncedEnforcer ::AddPolicies (const PoliciesValues & rules) {
348348 std::unique_lock<std::shared_mutex> lock (policyMutex);
349349 return Enforcer::AddPolicies (rules);
350350}
@@ -360,7 +360,7 @@ bool SyncedEnforcer ::AddNamedPolicy(const std::string& ptype, const std::vector
360360// AddNamedPolicies adds authorization rules to the current named policy.
361361// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
362362// Otherwise the function returns true for the corresponding by adding the new rule.
363- bool SyncedEnforcer ::AddNamedPolicies (const std::string& ptype, const std::vector<std::vector<std::string>> & rules) {
363+ bool SyncedEnforcer ::AddNamedPolicies (const std::string& ptype, const PoliciesValues & rules) {
364364 std::unique_lock<std::shared_mutex> lock (policyMutex);
365365 return Enforcer::AddNamedPolicies (ptype, rules);
366366}
@@ -383,18 +383,18 @@ bool SyncedEnforcer ::UpdateNamedPolicy(const std::string& ptype, const std::vec
383383}
384384
385385// UpdatePolicies updates authorization rules from the current policies.
386- bool SyncedEnforcer ::UpdatePolicies (const std::vector<std::vector<std::string>> & oldPolices, const std::vector<std::vector<std::string>> & newPolicies) {
386+ bool SyncedEnforcer ::UpdatePolicies (const PoliciesValues & oldPolices, const PoliciesValues & newPolicies) {
387387 std::unique_lock<std::shared_mutex> lock (policyMutex);
388388 return Enforcer::UpdatePolicies (oldPolices, newPolicies);
389389}
390390
391- bool SyncedEnforcer ::UpdateNamedPolicies (const std::string& ptype, const std::vector<std::vector<std::string>> & p1, const std::vector<std::vector<std::string>> & p2) {
391+ bool SyncedEnforcer ::UpdateNamedPolicies (const std::string& ptype, const PoliciesValues & p1, const PoliciesValues & p2) {
392392 std::unique_lock<std::shared_mutex> lock (policyMutex);
393393 return Enforcer::UpdateNamedPolicies (ptype, p1, p2);
394394}
395395
396396// RemovePolicies removes authorization rules from the current policy.
397- bool SyncedEnforcer ::RemovePolicies (const std::vector<std::vector<std::string>> & rules) {
397+ bool SyncedEnforcer ::RemovePolicies (const PoliciesValues & rules) {
398398 std::unique_lock<std::shared_mutex> lock (policyMutex);
399399 return Enforcer::RemovePolicies (rules);
400400}
@@ -412,7 +412,7 @@ bool SyncedEnforcer ::RemoveNamedPolicy(const std::string& ptype, const std::vec
412412}
413413
414414// RemoveNamedPolicies removes authorization rules from the current named policy.
415- bool SyncedEnforcer ::RemoveNamedPolicies (const std::string& ptype, const std::vector<std::vector<std::string>> & rules) {
415+ bool SyncedEnforcer ::RemoveNamedPolicies (const std::string& ptype, const PoliciesValues & rules) {
416416 std::unique_lock<std::shared_mutex> lock (policyMutex);
417417 return Enforcer::RemoveNamedPolicies (ptype, rules);
418418}
@@ -446,7 +446,7 @@ bool SyncedEnforcer ::AddGroupingPolicy(const std::vector<std::string>& params)
446446// AddGroupingPolicies adds role inheritance rulea to the current policy.
447447// If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added.
448448// Otherwise the function returns true for the corresponding policy rule by adding the new rule.
449- bool SyncedEnforcer ::AddGroupingPolicies (const std::vector<std::vector<std::string>> & rules) {
449+ bool SyncedEnforcer ::AddGroupingPolicies (const PoliciesValues & rules) {
450450 std::unique_lock<std::shared_mutex> lock (policyMutex);
451451 return Enforcer::AddGroupingPolicies (rules);
452452}
@@ -462,7 +462,7 @@ bool SyncedEnforcer ::AddNamedGroupingPolicy(const std::string& ptype, const std
462462// AddNamedGroupingPolicies adds named role inheritance rules to the current policy.
463463// If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added.
464464// Otherwise the function returns true for the corresponding policy rule by adding the new rule.
465- bool SyncedEnforcer ::AddNamedGroupingPolicies (const std::string& ptype, const std::vector<std::vector<std::string>> & rules) {
465+ bool SyncedEnforcer ::AddNamedGroupingPolicies (const std::string& ptype, const PoliciesValues & rules) {
466466 std::unique_lock<std::shared_mutex> lock (policyMutex);
467467 return Enforcer::AddNamedGroupingPolicies (ptype, rules);
468468}
@@ -474,7 +474,7 @@ bool SyncedEnforcer ::RemoveGroupingPolicy(const std::vector<std::string>& param
474474}
475475
476476// RemoveGroupingPolicies removes role inheritance rules from the current policy.
477- bool SyncedEnforcer ::RemoveGroupingPolicies (const std::vector<std::vector<std::string>> & rules) {
477+ bool SyncedEnforcer ::RemoveGroupingPolicies (const PoliciesValues & rules) {
478478 std::unique_lock<std::shared_mutex> lock (policyMutex);
479479 return Enforcer::RemoveGroupingPolicies (rules);
480480}
@@ -492,7 +492,7 @@ bool SyncedEnforcer ::RemoveNamedGroupingPolicy(const std::string& ptype, const
492492}
493493
494494// RemoveNamedGroupingPolicies removes role inheritance rules from the current named policy.
495- bool SyncedEnforcer ::RemoveNamedGroupingPolicies (const std::string& ptype, const std::vector<std::vector<std::string>> & rules) {
495+ bool SyncedEnforcer ::RemoveNamedGroupingPolicies (const std::string& ptype, const PoliciesValues & rules) {
496496 std::unique_lock<std::shared_mutex> lock (policyMutex);
497497 return Enforcer::RemoveNamedGroupingPolicies (ptype, rules);
498498}
0 commit comments