+bool acl_access_client_ok(UAContext *ua, const char *name, int32_t jobtype)
+{
+ if (acl_access_ok(ua, Client_ACL, name)) {
+ return true;
+ }
+ if (jobtype == JT_BACKUP && acl_access_ok(ua, BackupClient_ACL, name)) {
+ return true;
+ }
+ if (jobtype == JT_RESTORE && acl_access_ok(ua, RestoreClient_ACL, name)) {
+ return true;
+ }
+ /* Some commands such as "status client" are for both Backup and Restore */
+ if (jobtype == JT_BACKUP_RESTORE &&
+ (acl_access_ok(ua, RestoreClient_ACL, name) ||
+ acl_access_ok(ua, BackupClient_ACL, name)))
+ {
+ return true;
+ }
+ return false;
+}
+
+