diff --git a/fyle_rest_auth/helpers.py b/fyle_rest_auth/helpers.py index e496f60..b2d0538 100644 --- a/fyle_rest_auth/helpers.py +++ b/fyle_rest_auth/helpers.py @@ -101,7 +101,9 @@ def get_fyle_admin(access_token: str, origin_address: str = None) -> Dict: profile_api_url = '{}/platform/v1beta/spender/my_profile'.format(cluster_domain) employee_detail = get_request(profile_api_url, access_token, origin_address) - if 'ADMIN' in employee_detail['data']['roles']: + if 'ADMIN' in employee_detail['data']['roles'] or \ + ('FYLE_MODULE' in settings.FYLE_REST_AUTH_SERIALIZERS and \ + settings.FYLE_REST_AUTH_SERIALIZERS['FYLE_MODULE'] == 'PARTNER_DASHBOARD'): return employee_detail else: raise Exception('User is not an admin') diff --git a/setup.py b/setup.py index 38237f1..2580ff5 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name='fyle-rest-auth', - version='1.1.0', + version='1.2.0', author='Shwetabh Kumar', author_email='shwetabh.kumar@fyle.in', description='Django application to implement OAuth 2.0 using Fyle in Django rest framework',