class RoleItemPresenter extends ListItemPresenter<RolePermissions, BranchManagementPresenter, RoleItemPresenter.View> {

    @Override
    public RoleItemPresenter setup(final RolePermissions rolePermissions,
                                   final BranchManagementPresenter parentPresenter) {
        view.init(this);

        this.rolePermissions = rolePermissions;
        this.parentPresenter = parentPresenter;

        view.setRoleName(rolePermissions.getRoleName());
        view.setCanRead(rolePermissions.canRead());
        view.setCanWrite(rolePermissions.canWrite());
        view.setCanDelete(rolePermissions.canDelete());
        view.setCanDeploy(rolePermissions.canDeploy());

        if ("master".equals(parentPresenter.selectedBranch)) {
            view.disableCanRead();
        }

        return this;
    }

    @Inject public  RoleItemPresenter(final View view);

}