Before we have the performance issue of policies fixed, importing large amount of users requires the developer to implement a special import process. Basically the idea is to skip the policy syncs while importing, and trigger the policy sync only once after the import is finished.
- If you are using Create a person or Create or update a person endpoint for user imports, please switch to Create multiple persons endpoint instead first.
- To skip policy sync for an import, add
skipSyncPolicies=true
in the query string while calling Create multiple persons endpoint. - To trigger the policy sync after import is done, we need to get and then patch all policies.
-
Retrieve all policies by calling Retrieve all policies endpoint. A policy is a permission created on Proxy Dashboard. You might need to use proper
limit
andpage
query values if you have a lot of policies. -
For each policy, call the Update a policy endpoint, with
body
including the samedocument
field you got from Retrieve all policies endpoint. See example below. Note: We simplified the process by blindly patching all policies. If you're able to detect which policies are touched (by checking the groups of persons & policies), that would be optimal.PATCH https://api.proxy.com/manage/policies/723fa0a2-db30-4e6f-80ab-a85fddb190d7?orgId=848e74c5-712e-4402-b641-cbb862355bb4&siteId=ee334d52-1bad-41fe-a8f3-fb0163831613 { "document": { "Version": "2019-05-24", "Statement": { "Effect": "Allow", "Action": [ "unlock" ], "Grant": [ "proxy:person-group:2a116c91-7b39-488e-9c16-0eb5dc5fb6e4" ], "Resource": [ "proxy:door:beee2c58-747c-42d2-9e7f-6c49a0fa667c", "proxy:door:404e91e4-246e-4b39-9d00-9a99efcb9324", "proxy:door:56984ebb-4cb4-48ec-a983-ea2183e3f37c" ], "Ruleset": { "schedule": [] } } } }
-