Search in sources :

Example 1 with ChangeUserAccessSuccess

use of com.willshex.blogwt.client.api.user.event.ChangeUserAccessEventHandler.ChangeUserAccessSuccess in project blogwt by billy1380.

the class UserController method changeUserAccess.

private void changeUserAccess(Boolean revoke, User user, List<Permission> permissions, List<Role> roles, Boolean suspend, Date suspendUntil) {
    final ChangeUserAccessRequest input = ApiHelper.setAccessCode(new ChangeUserAccessRequest());
    input.session = SessionController.get().sessionForApiCall();
    input.user = user;
    input.revoke = revoke;
    input.roles = roles;
    input.permissions = permissions;
    input.suspend = suspend;
    input.suspendUntil = suspendUntil;
    ApiHelper.createUserClient().changeUserAccess(input, new AsyncCallback<ChangeUserAccessResponse>() {

        @Override
        public void onSuccess(ChangeUserAccessResponse output) {
            if (output.status == StatusType.StatusTypeSuccess) {
            }
            DefaultEventBus.get().fireEventFromSource(new ChangeUserAccessSuccess(input, output), UserController.this);
        }

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new ChangeUserAccessFailure(input, caught), UserController.this);
        }
    });
}
Also used : ChangeUserAccessResponse(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessResponse) ChangeUserAccessSuccess(com.willshex.blogwt.client.api.user.event.ChangeUserAccessEventHandler.ChangeUserAccessSuccess) ChangeUserAccessRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest) ChangeUserAccessFailure(com.willshex.blogwt.client.api.user.event.ChangeUserAccessEventHandler.ChangeUserAccessFailure)

Aggregations

ChangeUserAccessFailure (com.willshex.blogwt.client.api.user.event.ChangeUserAccessEventHandler.ChangeUserAccessFailure)1 ChangeUserAccessSuccess (com.willshex.blogwt.client.api.user.event.ChangeUserAccessEventHandler.ChangeUserAccessSuccess)1 ChangeUserAccessRequest (com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest)1 ChangeUserAccessResponse (com.willshex.blogwt.shared.api.user.call.ChangeUserAccessResponse)1