codemation / easyauth

Create a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions with very little database usage.
https://easyauth.readthedocs.io/en/latest/
MIT License
553 stars 52 forks source link

Default value missing #85

Closed Rictus closed 1 year ago

Rictus commented 1 year ago

Hello,

parse_permissions is called multiple times in the codebase but is always missing the default_permissions argument. I guess it miss a default value ?

https://github.com/codemation/easyauth/blob/7cf8ce8d5b8a5984054d64171aaa0d9e1dbc8eb7/easyauth/server.py#L964

My suggestion:

def parse_permissions(self, users, groups, roles, actions, default_permissions=None):
Rictus commented 1 year ago

This pull request https://github.com/codemation/easyauth/pull/86 aims to solve this

codemation commented 1 year ago

Hey @Rictus , good find, looks like this was missed when default permissions were refactored within EasyAuthRouter which does pass the permissions from self.parent. Looks good to merge after tests run.

codemation commented 1 year ago

Fixed in #86 - thanks for the contribution @Rictus