static.go 422 B

12345678910111213141516
  1. package permission
  2. //Get the largest storage quota from all the given groups. Return int64
  3. func GetLargestStorageQuotaFromGroups(groups []*PermissionGroup) int64 {
  4. maxQuota := int64(0)
  5. for _, group := range groups {
  6. if group.DefaultStorageQuota > maxQuota {
  7. maxQuota = group.DefaultStorageQuota
  8. } else if group.DefaultStorageQuota == -1 {
  9. //Inifnite. Max quota reached
  10. return -1
  11. }
  12. }
  13. return maxQuota
  14. }