mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ExtSvcAuth: Assign roles locally (#78669)
* ExtSvcAuth: Assign roles locally * Fix test * HandlePluginStateChanged in the OrgID * Remove Global from command * Use AssignmentOrgID instead of OrgID * Remove unecessary test case
This commit is contained in:
@@ -274,8 +274,7 @@ type SetResourcePermissionCommand struct {
|
||||
}
|
||||
|
||||
type SaveExternalServiceRoleCommand struct {
|
||||
OrgID int64
|
||||
Global bool
|
||||
AssignmentOrgID int64
|
||||
ExternalServiceID string
|
||||
ServiceAccountID int64
|
||||
Permissions []Permission
|
||||
@@ -289,10 +288,6 @@ func (cmd *SaveExternalServiceRoleCommand) Validate() error {
|
||||
// slugify the external service id ID for the role to have correct name and uid
|
||||
cmd.ExternalServiceID = slugify.Slugify(cmd.ExternalServiceID)
|
||||
|
||||
if (cmd.OrgID == GlobalOrgID) != cmd.Global {
|
||||
return fmt.Errorf("invalid org id %d for global role %t", cmd.OrgID, cmd.Global)
|
||||
}
|
||||
|
||||
// Check and deduplicate permissions
|
||||
if cmd.Permissions == nil || len(cmd.Permissions) == 0 {
|
||||
return errors.New("no permissions provided")
|
||||
|
||||
Reference in New Issue
Block a user