def is_role_request(request, role='user'):
 role_all = {'user': 'CU', 'admin': 'GA', 'super': 'SU'}
 if (request.user.role == role_all.get(role, 'CU')):
  return True
 else:
  return False

def is_role_request ( request , role = 'user' ) : role_all = { 'user' : 'CU' , 'admin' : 'GA' , 'super' : 'SU' } if ( request . user . role == role_all . get ( role , 'CU' ) ) : return True else : return False
require this request of user is right .