@@ -280,43 +280,43 @@ std::vector<std::string> SyncedEnforcer ::GetAllNamedRoles(const std::string& pt
280
280
}
281
281
282
282
// GetPolicy gets all the authorization rules in the policy.
283
- std::vector<std::vector<std::string>> SyncedEnforcer ::GetPolicy () {
283
+ PoliciesValues SyncedEnforcer ::GetPolicy () {
284
284
std::shared_lock<std::shared_mutex> lock (policyMutex);
285
285
return Enforcer::GetPolicy ();
286
286
}
287
287
288
288
// 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) {
290
290
std::shared_lock<std::shared_mutex> lock (policyMutex);
291
291
return Enforcer::GetNamedPolicy (ptype);
292
292
}
293
293
294
294
// 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) {
296
296
std::shared_lock<std::shared_mutex> lock (policyMutex);
297
297
return Enforcer::GetFilteredNamedPolicy (ptype, fieldIndex, fieldValues);
298
298
}
299
299
300
300
// GetGroupingPolicy gets all the role inheritance rules in the policy.
301
- std::vector<std::vector<std::string>> SyncedEnforcer ::GetGroupingPolicy () {
301
+ PoliciesValues SyncedEnforcer ::GetGroupingPolicy () {
302
302
std::shared_lock<std::shared_mutex> lock (policyMutex);
303
303
return Enforcer::GetGroupingPolicy ();
304
304
}
305
305
306
306
// 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) {
308
308
std::shared_lock<std::shared_mutex> lock (policyMutex);
309
309
return Enforcer::GetFilteredGroupingPolicy (fieldIndex, fieldValues);
310
310
}
311
311
312
312
// 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) {
314
314
std::shared_lock<std::shared_mutex> lock (policyMutex);
315
315
return Enforcer::GetNamedGroupingPolicy (ptype);
316
316
}
317
317
318
318
// 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) {
320
320
std::shared_lock<std::shared_mutex> lock (policyMutex);
321
321
return Enforcer::GetFilteredNamedGroupingPolicy (ptype, fieldIndex, fieldValues);
322
322
}
@@ -344,7 +344,7 @@ bool SyncedEnforcer ::AddPolicy(const std::vector<std::string>& params) {
344
344
// AddPolicies adds authorization rules to the current policy.
345
345
// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
346
346
// 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) {
348
348
std::unique_lock<std::shared_mutex> lock (policyMutex);
349
349
return Enforcer::AddPolicies (rules);
350
350
}
@@ -360,7 +360,7 @@ bool SyncedEnforcer ::AddNamedPolicy(const std::string& ptype, const std::vector
360
360
// AddNamedPolicies adds authorization rules to the current named policy.
361
361
// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
362
362
// 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) {
364
364
std::unique_lock<std::shared_mutex> lock (policyMutex);
365
365
return Enforcer::AddNamedPolicies (ptype, rules);
366
366
}
@@ -383,18 +383,18 @@ bool SyncedEnforcer ::UpdateNamedPolicy(const std::string& ptype, const std::vec
383
383
}
384
384
385
385
// 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) {
387
387
std::unique_lock<std::shared_mutex> lock (policyMutex);
388
388
return Enforcer::UpdatePolicies (oldPolices, newPolicies);
389
389
}
390
390
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) {
392
392
std::unique_lock<std::shared_mutex> lock (policyMutex);
393
393
return Enforcer::UpdateNamedPolicies (ptype, p1, p2);
394
394
}
395
395
396
396
// 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) {
398
398
std::unique_lock<std::shared_mutex> lock (policyMutex);
399
399
return Enforcer::RemovePolicies (rules);
400
400
}
@@ -412,7 +412,7 @@ bool SyncedEnforcer ::RemoveNamedPolicy(const std::string& ptype, const std::vec
412
412
}
413
413
414
414
// 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) {
416
416
std::unique_lock<std::shared_mutex> lock (policyMutex);
417
417
return Enforcer::RemoveNamedPolicies (ptype, rules);
418
418
}
@@ -446,7 +446,7 @@ bool SyncedEnforcer ::AddGroupingPolicy(const std::vector<std::string>& params)
446
446
// AddGroupingPolicies adds role inheritance rulea to the current policy.
447
447
// If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added.
448
448
// 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) {
450
450
std::unique_lock<std::shared_mutex> lock (policyMutex);
451
451
return Enforcer::AddGroupingPolicies (rules);
452
452
}
@@ -462,7 +462,7 @@ bool SyncedEnforcer ::AddNamedGroupingPolicy(const std::string& ptype, const std
462
462
// AddNamedGroupingPolicies adds named role inheritance rules to the current policy.
463
463
// If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added.
464
464
// 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) {
466
466
std::unique_lock<std::shared_mutex> lock (policyMutex);
467
467
return Enforcer::AddNamedGroupingPolicies (ptype, rules);
468
468
}
@@ -474,7 +474,7 @@ bool SyncedEnforcer ::RemoveGroupingPolicy(const std::vector<std::string>& param
474
474
}
475
475
476
476
// 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) {
478
478
std::unique_lock<std::shared_mutex> lock (policyMutex);
479
479
return Enforcer::RemoveGroupingPolicies (rules);
480
480
}
@@ -492,7 +492,7 @@ bool SyncedEnforcer ::RemoveNamedGroupingPolicy(const std::string& ptype, const
492
492
}
493
493
494
494
// 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) {
496
496
std::unique_lock<std::shared_mutex> lock (policyMutex);
497
497
return Enforcer::RemoveNamedGroupingPolicies (ptype, rules);
498
498
}
0 commit comments