mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
1ebfbb14eb
#8593 This PR adds a new role `gitops` to Fleet. MDM capabilities for the role coming on a separate PR. We need this merged ASAP so that we can unblock the UI work for this. - [X] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - [X] Documented any permissions changes - ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements)~ - ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.~ - [X] Added/updated tests - [x] Manual QA for all new/changed functionality - ~For Orbit and Fleet Desktop changes:~ - ~[ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux.~ - ~[ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
139 lines
2.4 KiB
Go
139 lines
2.4 KiB
Go
package test
|
|
|
|
import (
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
"github.com/fleetdm/fleet/v4/server/ptr"
|
|
)
|
|
|
|
var (
|
|
GoodPassword = "password123#"
|
|
GoodPassword2 = "password123!"
|
|
UserNoRoles = &fleet.User{
|
|
ID: 1,
|
|
}
|
|
UserAdmin = &fleet.User{
|
|
ID: 2,
|
|
GlobalRole: ptr.String(fleet.RoleAdmin),
|
|
Email: "useradmin@example.com",
|
|
}
|
|
UserMaintainer = &fleet.User{
|
|
ID: 3,
|
|
GlobalRole: ptr.String(fleet.RoleMaintainer),
|
|
}
|
|
UserObserver = &fleet.User{
|
|
ID: 4,
|
|
GlobalRole: ptr.String(fleet.RoleObserver),
|
|
}
|
|
UserTeamAdminTeam1 = &fleet.User{
|
|
ID: 5,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleAdmin,
|
|
},
|
|
},
|
|
}
|
|
UserTeamAdminTeam2 = &fleet.User{
|
|
ID: 6,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleAdmin,
|
|
},
|
|
},
|
|
}
|
|
UserTeamMaintainerTeam1 = &fleet.User{
|
|
ID: 7,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleMaintainer,
|
|
},
|
|
},
|
|
}
|
|
UserTeamMaintainerTeam2 = &fleet.User{
|
|
ID: 8,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleMaintainer,
|
|
},
|
|
},
|
|
}
|
|
UserTeamObserverTeam1 = &fleet.User{
|
|
ID: 9,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleObserver,
|
|
},
|
|
},
|
|
}
|
|
UserTeamObserverTeam2 = &fleet.User{
|
|
ID: 10,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleObserver,
|
|
},
|
|
},
|
|
}
|
|
UserTeamObserverTeam1TeamAdminTeam2 = &fleet.User{
|
|
ID: 11,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleObserver,
|
|
},
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleAdmin,
|
|
},
|
|
},
|
|
}
|
|
UserObserverPlus = &fleet.User{
|
|
ID: 12,
|
|
GlobalRole: ptr.String(fleet.RoleObserverPlus),
|
|
}
|
|
UserTeamObserverPlusTeam1 = &fleet.User{
|
|
ID: 13,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleObserverPlus,
|
|
},
|
|
},
|
|
}
|
|
UserTeamObserverPlusTeam2 = &fleet.User{
|
|
ID: 14,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleObserverPlus,
|
|
},
|
|
},
|
|
}
|
|
UserGitOps = &fleet.User{
|
|
ID: 15,
|
|
GlobalRole: ptr.String(fleet.RoleGitOps),
|
|
}
|
|
UserTeamGitOpsTeam1 = &fleet.User{
|
|
ID: 16,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 1},
|
|
Role: fleet.RoleGitOps,
|
|
},
|
|
},
|
|
}
|
|
UserTeamGitOpsTeam2 = &fleet.User{
|
|
ID: 17,
|
|
Teams: []fleet.UserTeam{
|
|
{
|
|
Team: fleet.Team{ID: 2},
|
|
Role: fleet.RoleGitOps,
|
|
},
|
|
},
|
|
}
|
|
)
|