def role_write(self, fail_on_found=False, disassociate=False, **kwargs):
<EOL>data, self.endpoint = self.data_endpoint(kwargs, ignore=['<STR_LIT>'])<EOL>debug.log('<STR_LIT>', header='<STR_LIT>')<EOL>response = self.read(pk=None, fail_on_no_results=True,<EOL>fail_on_multiple_results=True, **data)<EOL>role_data = response['<STR_LIT>'][<NUM_LIT:0>]<EOL>role_id = role_data['<STR_LIT:id>']<EOL>self.configure_display(role_data, kwargs, write=True)<EOL>obj, obj_type, res, res_type = self.obj_res(kwargs)<EOL>debug.log('<STR_LIT>' % obj_type,<EOL>header='<STR_LIT>')<EOL>data, self.endpoint = self.data_endpoint(kwargs)<EOL>data['<STR_LIT>'] = res_type.replace('<STR_LIT:_>', '<STR_LIT>')<EOL>response = self.read(pk=None, fail_on_no_results=False,<EOL>fail_on_multiple_results=False, **data)<EOL>msg = '<STR_LIT>'<EOL>if response['<STR_LIT:count>'] > <NUM_LIT:0> and not disassociate:<EOL><INDENT>msg = '<STR_LIT>' % obj_type<EOL><DEDENT>elif response['<STR_LIT:count>'] == <NUM_LIT:0> and disassociate:<EOL><INDENT>msg = '<STR_LIT>' % obj_type<EOL><DEDENT>if msg:<EOL><INDENT>role_data['<STR_LIT>'] = False<EOL>if fail_on_found:<EOL><INDENT>raise exc.NotFound(msg)<EOL><DEDENT>else:<EOL><INDENT>debug.log(msg, header='<STR_LIT>')<EOL>return role_data<EOL><DEDENT><DEDENT>debug.log('<STR_LIT>' % (<EOL>'<STR_LIT>' if disassociate else '<STR_LIT>', obj_type), header='<STR_LIT>')<EOL>post_data = {'<STR_LIT:id>': role_id}<EOL>if disassociate:<EOL><INDENT>post_data['<STR_LIT>'] = True<EOL><DEDENT>client.post('<STR_LIT>' % (grammar.pluralize(obj_type), obj),<EOL>data=post_data)<EOL>role_data['<STR_LIT>'] = True<EOL>return role_data<EOL>
Re-implementation of the parent `write` method specific to roles.
        Adds a grantee (user or team) to the resource's role.