X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4e1f73e620d876cdc1e87912d58f1c7a1028996b..fb3c428d131902964322f20c4b23b21e884e404d:/services/api/app/models/arvados_model.rb diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb index 0069584f65..c5c3dd2579 100644 --- a/services/api/app/models/arvados_model.rb +++ b/services/api/app/models/arvados_model.rb @@ -42,7 +42,7 @@ class ArvadosModel < ActiveRecord::Base end def permission_to_create - current_user + current_user.andand.is_active end def ensure_permission_to_update @@ -54,6 +54,10 @@ class ArvadosModel < ActiveRecord::Base logger.warn "Anonymous user tried to update #{self.class.to_s} #{self.uuid_was}" return false end + if !current_user.is_active + logger.warn "Inactive user #{current_user.uuid} tried to update #{self.class.to_s} #{self.uuid_was}" + return false + end if self.uuid_changed? logger.warn "User #{current_user.uuid} tried to change uuid of #{self.class.to_s} #{self.uuid_was} to #{self.uuid}" return false