- # Return a hash of {group_uuid: perm_hash} where perm_hash[:read]
- # and perm_hash[:write] are true if this user can read and write
- # objects owned by group_uuid.
- def group_permissions
- r = Rails.cache.read "#{PERM_CACHE_PREFIX}#{self.uuid}"
- if r.nil?
- if Rails.configuration.async_permissions_update
- while r.nil?
- sleep(0.1)
- r = Rails.cache.read "#{PERM_CACHE_PREFIX}#{self.uuid}"
- end
- else
- r = calculate_group_permissions
- end
- end
- r
- end
-