GetRoleIDs returns IDs of all roles, Includes deleted roles based on given flag It choses which View/Index to use based on combination of useViews and includeDeleted When Views is enabled and includeDeleted is true, ViewPrincipal is used to fetch roles when View is enabled and includeDelete is fals
(ctx context.Context, useViews, includeDeleted bool)
| 1444 | // when View is enabled and includeDelete is false, ViewRolesExcludeDelete is used |
| 1445 | // Otherwise RoleIndex is used to fetch roles |
| 1446 | func (db *DatabaseContext) GetRoleIDs(ctx context.Context, useViews, includeDeleted bool) (roles []string, err error) { |
| 1447 | if useViews && includeDeleted { |
| 1448 | _, roles, err = db.AllPrincipalIDs(ctx) |
| 1449 | } else { |
| 1450 | roles, err = db.getRoleIDsUsingIndex(ctx, includeDeleted) |
| 1451 | } |
| 1452 | |
| 1453 | if err != nil { |
| 1454 | return nil, err |
| 1455 | } |
| 1456 | |
| 1457 | return roles, nil |
| 1458 | } |
| 1459 | |
| 1460 | type compactProgressCallbackFunc func(purgedDocCount *int) |
| 1461 |