• Home
  • Raw
  • Download

Lines Matching refs:permissions

232 static int SavePermissions(const char *identifier, const PermissionSaved *permissions, int permNum)  in SavePermissions()  argument
234 if (identifier == NULL || permissions == NULL) { in SavePermissions()
255 cJSON_AddItemToObject(object, FIELD_NAME, cJSON_CreateString(permissions[i].name)); in SavePermissions()
256 cJSON_AddItemToObject(object, FIELD_DESC, cJSON_CreateString(permissions[i].desc)); in SavePermissions()
257 cJSON_AddItemToObject(object, FIELD_IS_GRANTED, cJSON_CreateBool(permissions[i].granted)); in SavePermissions()
265 if (sprintf_s(buf, BUFF_PARAM_SIZE, "%d", permissions[i].flags) < 0) { in SavePermissions()
316 int QueryPermission(const char *identifier, PermissionSaved **permissions, int *permNum) in QueryPermission() argument
324 int ret = ParsePermissions(jsonStr, permissions, permNum); in QueryPermission()
334 PermissionSaved *permissions = NULL; in QueryAppCapabilities() local
336 int ret = QueryPermission(identifier, &permissions, &permNum); in QueryAppCapabilities()
342 HalFree((void *)permissions); in QueryAppCapabilities()
347 HalFree((void *)permissions); in QueryAppCapabilities()
356 … if (strcmp(permissions[j].name, permList[i].name) || permList[i].cap == CAP_NOT_BINDED) { in QueryAppCapabilities()
364 HalFree((void *)permissions); in QueryAppCapabilities()
386 PermissionSaved *permissions = NULL; in UpdateAppPermission() local
390 retCode = QueryPermission(identifier, &permissions, &permNum); in UpdateAppPermission()
398 HalFree((void *)permissions); in UpdateAppPermission()
404 HalFree((void *)permissions); in UpdateAppPermission()
409 HalFree((void *)permissions); in UpdateAppPermission()
414 HalFree((void *)permissions); in UpdateAppPermission()
424 if (strcmp(newPerms[i].name, (permissions + j)->name) == 0) { in UpdateAppPermission()
425 updatePerms[i].granted = permissions[j].granted; in UpdateAppPermission()
431 HalFree((void *)permissions); in UpdateAppPermission()
436 const char *identifier, PermissionTrans permissions[], int permNum, enum IsUpdate isUpdate) in SaveOrUpdatePermissions() argument
438 if ((identifier == NULL) || (permissions == NULL) || (permNum < 0) || in SaveOrUpdatePermissions()
466 permissions[distinctNum++] = permissions[i]; in SaveOrUpdatePermissions()
468 if (strcmp(permissions[i].name, permissions[j].name) == 0) { in SaveOrUpdatePermissions()
475 return UpdateAppPermission(identifier, permissions, distinctNum, isUpdate); in SaveOrUpdatePermissions()
540 PermissionSaved *permissions = NULL; in LoadPermissions() local
542 int ret = QueryPermission(identifier, &permissions, &permNum); in LoadPermissions()
554 HalFree((void *)permissions); in LoadPermissions()
560 HalFree((void *)permissions); in LoadPermissions()
565 node->permList = permissions; in LoadPermissions()
598 PermissionSaved *permissions = NULL; in OnPermissionFileSync() local
600 int ret = QueryPermission(identifier, &permissions, &permNum); in OnPermissionFileSync()
605 if (strcmp(permissions[i].name, permName) == 0) { in OnPermissionFileSync()
606 isSave = permissions[i].granted ^ granted; in OnPermissionFileSync()
607 permissions[i].granted = granted; in OnPermissionFileSync()
612 retCode = SavePermissions(identifier, permissions, permNum); in OnPermissionFileSync()
614 HalFree((void *)permissions); in OnPermissionFileSync()
622 PermissionSaved *permissions = NULL; in OnPermissionFlagsFileSync() local
624 int ret = QueryPermission(identifier, &permissions, &permNum); in OnPermissionFlagsFileSync()
629 if (strcmp(permissions[i].name, permName) == 0) { in OnPermissionFlagsFileSync()
630 isSave = permissions[i].flags ^ flags; in OnPermissionFlagsFileSync()
631 permissions[i].flags = flags; in OnPermissionFlagsFileSync()
636 retCode = SavePermissions(identifier, permissions, permNum); in OnPermissionFlagsFileSync()
638 HalFree((void *)permissions); in OnPermissionFlagsFileSync()