def check_is_admin(roles):
 init()
 action = 'context_is_admin'
 match_list = (('rule:%s' % action),)
 target = {'project_id': ''}
 credentials = {'roles': roles}
 return policy.enforce(match_list, target, credentials)

def check_is_admin ( roles ) : init ( ) action = 'context_is_admin' match_list = ( ( 'rule:%s' % action ) , ) target = { 'project_id' : '' } credentials = { 'roles' : roles } return policy . enforce ( match_list , target , credentials )
whether or not roles contains admin role according to policy setting .