更新成员的角色信息
@param memberId  成员的 client id
@param role      角色
@param callback  结果回调函数
335903
public void updateMemberRole(final String memberId, final ConversationMemberRole role, final AVIMConversationCallback callback) {
    AVIMConversationMemberInfo info = new AVIMConversationMemberInfo(this.conversationId, memberId, role);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put(Conversation.PARAM_CONVERSATION_MEMBER_DETAILS, info.getUpdateAttrs());
    boolean ret = InternalConfiguration.getOperationTube().processMembers(this.client.getClientId(), this.conversationId,
            getType(), JSON.toJSONString(params), Conversation.AVIMOperation.CONVERSATION_PROMOTE_MEMBER, callback);
    if (!ret && null != callback) {
      callback.internalDone(new AVException(AVException.OPERATION_FORBIDDEN, "couldn't start service in background."));
    }
  }
131799
function (callbackId, data, keepAlive) {
    const args = [callbackId]
    data && args.push(data)
    keepAlive && args.push(keepAlive)
    _send(this.instanceId, {
      method: 'callback',
      args: args
    })
  }
900381
public function updatePolicyByRoleDraft($roleId, $policyId, Request $request)
    {
        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        $role = $this->roleService->loadRoleDraft($roleId);
        foreach ($role->getPolicies() as $policy) {
            if ($policy->id == $policyId) {
                try {
                    return $this->roleService->updatePolicy(
                        $policy,
                        $updateStruct
                    );
                } catch (LimitationValidationException $e) {
                    throw new BadRequestException($e->getMessage());
                }
            }
        }

        throw new Exceptions\NotFoundException("Policy not found: '{$request->getPathInfo()}'.");
    }
470545
@PUT
    @Path("{group}/{id}")
    @Consumes(MediaType.APPLICATION_JSON)
    public SuccessResponse updateRole(@PathParam("group") String group, @PathParam("id") String id,
                                      EmoRole role, final @Authenticated Subject subject) {
        checkArgument(role.getId().equals(new EmoRoleKey(group, id)),
                "Body contains conflicting role identifier");

        return updateRoleFromUpdateRequest(group, id,
                new UpdateEmoRoleRequest()
                        .setName(role.getName())
                        .setDescription(role.getDescription())
                        .setGrantedPermissions(role.getPermissions())
                        .setRevokeOtherPermissions(true),
                subject);
    }
1137708
private function processRole(string $role, int $resource_id, string $method_code, int $action_id, $module_id = null) : int {
		// load all roles from datasource
		if (is_null(self::$cached_roles) && !\Object\Error\Base::$flag_database_tenant_not_found) {
			self::$cached_roles = \Object\ACL\Resources::getStatic('roles', 'primary');
		}
		// if role is not found
		if (empty(self::$cached_roles[$role])) return 0;
		// process permissions
		$all_actions = self::$cached_roles[$role]['permissions'][$resource_id]['AllActions'][-1] ?? [];
		$actual_action = self::$cached_roles[$role]['permissions'][$resource_id][$method_code][$action_id] ?? [];
		$temp = array_merge_hard($all_actions, $actual_action);
		if (!empty($temp)) {
			if (!empty($module_id)) {
				$temp = $temp[$module_id] ?? null;
			} else { // find any active permision
				$temp2 = $temp;
				$temp = null;
				foreach ($temp2 as $k => $v) {
					if ($v === 0) {
						$temp = 0;
						break;
					}
				}
			}
		}
		if ($temp === 0) {
			return 1;
		} else if ($temp === 1) {
			return 2;
		}
		// super admin
		if (!empty(self::$cached_roles[$role]['super_admin'])) return 1;
		// if permission is not found we need to check parents
		if (empty(self::$cached_roles[$role]['parents'])) return 0;
		// go though parents
		foreach (self::$cached_roles[$role]['parents'] as $k => $v) {
			if (!empty($v)) continue;
			$temp = $this->processRole($k, $resource_id, $method_code, $action_id);
			if ($temp === 1) {
				return 1;
			} else if ($temp === 2) {
				return 2;
			}
		}
		return 0;
	}
387049
@Override
    public void setClientId(final String clientId) {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setClientId", clientId);
        }
        _clientId = clientId;
    }
83837
private void loginUser(final String userId, final String password, final BooleanCallback callback) {
		LoginRequest request = new LoginRequest();
		request.setLogin(userId);
		request.setPassword(password);
		GwtCommand command = new GwtCommand(loginCommandName);
		command.setCommandRequest(request);
		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<LoginResponse>() {

			public void execute(LoginResponse loginResponse) {
				if (loginResponse.getToken() == null) {
					if (callback != null) {
						callback.execute(false);
					}
					manager.fireEvent(new LoginFailureEvent(loginResponse.getErrorMessages()));
				} else {
					userToken = loginResponse.getToken();
					Authentication.this.userId = userId;
					UserDetail userDetail = GwtCommandDispatcher.getInstance().getUserDetail();
					userDetail.setUserId(loginResponse.getUserId());
					userDetail.setUserName(loginResponse.getUserName());
					userDetail.setUserOrganization(loginResponse.getUserOrganization());
					userDetail.setUserDivision(loginResponse.getUserDivision());
					userDetail.setUserLocale(loginResponse.getUserLocale());
					if (callback != null) {
						callback.execute(true);
					}
					manager.fireEvent(new LoginSuccessEvent(userToken));
				}
			}
		});
	}
1037341
public CompletableFuture<Revision> updateMemberRole(Author author, String projectName,
                                                        User member, ProjectRole projectRole) {
        requireNonNull(author, "author");
        requireNonNull(projectName, "projectName");
        requireNonNull(member, "member");
        requireNonNull(projectRole, "projectRole");

        final Change<JsonNode> change = Change.ofJsonPatch(
                METADATA_JSON,
                new ReplaceOperation(JsonPointer.compile("/members" + encodeSegment(member.id()) + "/role"),
                                     Jackson.valueToTree(projectRole)).toJsonNode());
        final String commitSummary = "Updates the role of the member '" + member.id() +
                                     "' as '" + projectRole + "' for the project " + projectName;
        return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
    }
874279
def delete_role(role_id)
      @roles.reject! { |r| r.id == role_id }
      @members.each do |_, member|
        new_roles = member.roles.reject { |r| r.id == role_id }
        member.update_roles(new_roles)
      end
      @channels.each do |channel|
        overwrites = channel.permission_overwrites.reject { |id, _| id == role_id }
        channel.update_overwrites(overwrites)
      end
    end
871154
public function updatePolicy($roleId, $policyId, Request $request)
    {
        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        try {
            // First try to treat $roleId as a role draft ID.
            $role = $this->roleService->loadRoleDraft($roleId);
            foreach ($role->getPolicies() as $policy) {
                if ($policy->id == $policyId) {
                    try {
                        return $this->roleService->updatePolicy(
                            $policy,
                            $updateStruct
                        );
                    } catch (LimitationValidationException $e) {
                        throw new BadRequestException($e->getMessage());
                    }
                }
            }
        } catch (NotFoundException $e) {
            // Then try to treat $roleId as a role ID.
            $role = $this->roleService->loadRole($roleId);
            foreach ($role->getPolicies() as $policy) {
                if ($policy->id == $policyId) {
                    try {
                        return $this->roleService->updatePolicy(
                            $policy,
                            $updateStruct
                        );
                    } catch (LimitationValidationException $e) {
                        throw new BadRequestException($e->getMessage());
                    }
                }
            }
        }

        throw new Exceptions\NotFoundException("Policy not found: '{$request->getPathInfo()}'.");
    }
764167
@Process(actionType = ModifyStandardRole.class)
    public void modifyStandardRole(final ModifyStandardRole action, final Channel channel) {
        Role role = action.getRole();
        new Async<FunctionContext>().waterfall(new FunctionContext(), new ReloadOutcome(channel),
                new AccessControlFunctions.CheckAssignment(dispatcher, role),
                new AccessControlFunctions.AddAssignment(dispatcher, role, status -> status == 404),
                new AccessControlFunctions.ModifyIncludeAll(dispatcher, role));
    }
1054354
public Request delete(String roleId) {
    Asserts.assertNotNull(roleId, "role id");

    final String url = baseUrl
        .newBuilder()
        .addEncodedPathSegments("api/v2/roles")
        .addEncodedPathSegments(roleId)
        .build()
        .toString();
    VoidRequest request = new VoidRequest(this.client, url, "DELETE");
    request.addHeader("Authorization", "Bearer " + apiToken);
    return request;
  }
945612
public PrimaryBackupSession createSession(long sessionId, MemberId memberId) {
    PrimaryBackupSession session = new PrimaryBackupSession(SessionId.from(sessionId), memberId, service.serializer(), this);
    if (sessions.putIfAbsent(sessionId, session) == null) {
      service.register(session);
    }
    return session;
  }
1196074
public void handleDelete(
        final String clientId,
        final String deleteOption,
        final I_CmsSimpleCallback<Void> callback) {

        CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

            @Override
            public void execute() {

                getContainerpageService().handleDelete(
                    clientId,
                    deleteOption,
                    getData().getRpcContext().getPageStructureId(),
                    getData().getRequestParams(),
                    this);
            }

            @Override
            protected void onResponse(Void result) {

                if (callback != null) {
                    callback.execute(result);
                }
            }
        };
        action.execute();
    }
769322
protected void addGroupToRole(String group, String role) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, CLASS_NAME + "addGroupToRole", new Object[] { group, role });
        }
        Set<String> groupsForTheRole = roleToGroupMap.get(role);
        if (groupsForTheRole != null) {
            groupsForTheRole.add(group);
        } else {
            groupsForTheRole = new HashSet<String>();
            groupsForTheRole.add(group);
        }
        roleToGroupMap.put(role, groupsForTheRole);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, CLASS_NAME + "addGroupToRole");
        }
    }
1372657
public void createNewElement(
        final CmsContainerPageElementPanel element,
        final AsyncCallback<CmsContainerElement> callback) {

        CmsRpcAction<CmsContainerElement> action = new CmsRpcAction<CmsContainerElement>() {

            @Override
            public void execute() {

                getContainerpageService().createNewElement(
                    CmsCoreProvider.get().getStructureId(),
                    element.getId(),
                    element.getNewType(),
                    null,
                    getLocale(),
                    this);

            }

            @Override
            protected void onResponse(CmsContainerElement result) {

                callback.onSuccess(result);
            }
        };
        action.execute();
    }
121624
public void setClientId(String clientId) throws HelloSignException {
        if (clientId == null) {
            throw new HelloSignException("Client ID cannot be null");
        }
        this.clientId = clientId.trim();
    }