Skip to content

Commit

Permalink
fix: shared cloudprovider not accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiu Jian committed May 6, 2020
1 parent 68bcd4f commit a2a6024
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/compute/models/cloudproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -1514,3 +1514,13 @@ func (provider *SCloudprovider) getAccountShareInfo() apis.SAccountShareInfo {
account := provider.GetCloudaccount()
return account.getAccountShareInfo()
}

func (provider *SCloudprovider) IsSharable(reqUsrId mcclient.IIdentityProvider) bool {
account := provider.GetCloudaccount()
if account != nil {
if account.ShareMode == api.CLOUD_ACCOUNT_SHARE_MODE_SYSTEM {
return account.IsSharable(reqUsrId)
}
}
return false
}

0 comments on commit a2a6024

Please sign in to comment.