mumuki / mumuki-domain

💡 Mumuki's domain model
GNU Affero General Public License v3.0
1 stars 0 forks source link

Fetching user fails when permissions are broken #211

Open julian-berbel opened 3 years ago

julian-berbel commented 3 years ago

A user was created by accident with broken permissions in the form of: {"teacher":"/some-course-slug"} (with missing first part of slug)

Trying to fetch this user with locate! in console to repair their permissions resulted in Mumukit::Auth::InvalidSlugFormatError (Invalid slug: /some-course-slug. It must be in first/second format) (This of course means querying through api was broken too)

Ideally user object should not fail to created on fetch in order to make fixing permissions easier (and even further, it should fail to save when permissions are broken)