emmett-framework / emmett

The web framework for inventors
Other
1.03k stars 70 forks source link

PK uuid and auth_permission #437

Open josejachuf opened 2 years ago

josejachuf commented 2 years ago

Taking into account the UUID type PK support. How is it resolved in auth_permission record_id (integer) field?

Sample of docs:

maintenance = db.Preference(name='maintenance').first()
auth.add_permission(admins, 'write', 'Preference', maintenance.id)
auth.has_permission('write', 'Preference', maintenance.id)

If Preference.id is uuid, this would not work.

Jose

gi0baro commented 2 years ago

@josejachuf you right, I didn't take into account permissions.

This sounds a bit complex, I need to spend some time on this in order to find a backward compatible way of supporting this. Ideally will be in 2.5